public final class JsonUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
bool(com.fasterxml.jackson.databind.node.ObjectNode node,
java.lang.String name)
Returns the specified node property as a boolean.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
envelope(java.lang.String type,
com.fasterxml.jackson.databind.node.ObjectNode payload)
Composes a message structure for the given message type and payload.
|
static java.lang.String |
eventType(com.fasterxml.jackson.databind.node.ObjectNode event)
Returns the event type from the specified event.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
node(com.fasterxml.jackson.databind.node.ObjectNode node,
java.lang.String name)
Returns the specified node property as an object node.
|
static long |
number(com.fasterxml.jackson.databind.node.ObjectNode node,
java.lang.String name)
Returns the specified node property as a number.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
payload(com.fasterxml.jackson.databind.node.ObjectNode event)
Returns the payload from the specified event.
|
static java.lang.String |
string(com.fasterxml.jackson.databind.node.ObjectNode node,
java.lang.String name)
Returns the specified node property as a string.
|
static java.lang.String |
string(com.fasterxml.jackson.databind.node.ObjectNode node,
java.lang.String name,
java.lang.String defaultValue)
Returns the specified node property as a string, with a default fallback.
|
public static com.fasterxml.jackson.databind.node.ObjectNode envelope(java.lang.String type, com.fasterxml.jackson.databind.node.ObjectNode payload)
type
- message typepayload
- message payloadpublic static java.lang.String eventType(com.fasterxml.jackson.databind.node.ObjectNode event)
event
- message eventpublic static com.fasterxml.jackson.databind.node.ObjectNode payload(com.fasterxml.jackson.databind.node.ObjectNode event)
event
- message eventpublic static long number(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String name)
node
- object nodename
- property namepublic static java.lang.String string(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String name)
node
- object nodename
- property namepublic static java.lang.String string(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String name, java.lang.String defaultValue)
node
- object nodename
- property namedefaultValue
- fallback value if property is absentpublic static com.fasterxml.jackson.databind.node.ObjectNode node(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String name)
node
- object nodename
- property namepublic static boolean bool(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String name)
node
- object nodename
- property name