public class JsonPayloadUtil extends BasePayload
| Constructor and Description |
|---|
JsonPayloadUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Payload |
toPayload(Object obj)
Creates a new payload that will use a default
ObjectMapper to
write the provided object to an OutputStream using
BasePayload.writeTo(OutputStream). |
static Payload |
toPayload(Object obj,
ObjectMapper mapper)
Creates a new payload that will using the provided
ObjectMapper
to write the provided object to an OutputStream using
BasePayload.writeTo(OutputStream). |
static Payload |
toPayload(TreeNode node)
Creates a new payload that will use a default
ObjectMapper to
write the provided TreeNode to an OutputStream using
BasePayload.writeTo(OutputStream). |
close, getMetadata, readFrom, writeTopublic static Payload toPayload(Object obj)
ObjectMapper to
write the provided object to an OutputStream using
BasePayload.writeTo(OutputStream). The ObjectMapper used by this
method does not allow access modifiers to be overridden and will not fail
when writing empty beans.obj - the object to writenull, null otherwisepublic static Payload toPayload(Object obj, ObjectMapper mapper)
ObjectMapper
to write the provided object to an OutputStream using
BasePayload.writeTo(OutputStream).obj - the object to writemapper - the mapper used to write the objectnull, null otherwisepublic static Payload toPayload(TreeNode node)
ObjectMapper to
write the provided TreeNode to an OutputStream using
BasePayload.writeTo(OutputStream). The ObjectMapper used by this
method does not allow access modifiers to be overridden and will not fail
when writing empty beans.node - the object to writenull, null otherwise