public final class JsonUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
bool(com.fasterxml.jackson.databind.node.ObjectNode node,
String name)
Returns the specified node property as a boolean.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
envelope(String type,
com.fasterxml.jackson.databind.node.ObjectNode payload)
Composes a message structure for the given message type and payload.
|
static 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,
String name)
Returns the specified node property as an object node.
|
static long |
number(com.fasterxml.jackson.databind.node.ObjectNode node,
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 String |
string(com.fasterxml.jackson.databind.node.ObjectNode node,
String name)
Returns the specified node property as a string.
|
static String |
string(com.fasterxml.jackson.databind.node.ObjectNode node,
String name,
String defaultValue)
Returns the specified node property as a string, with a default fallback.
|
public static com.fasterxml.jackson.databind.node.ObjectNode envelope(String type, com.fasterxml.jackson.databind.node.ObjectNode payload)
type - message typepayload - message payloadpublic static 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,
String name)
node - object nodename - property namepublic static String string(com.fasterxml.jackson.databind.node.ObjectNode node, String name)
node - object nodename - property namepublic static String string(com.fasterxml.jackson.databind.node.ObjectNode node, String name, 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,
String name)
node - object nodename - property namepublic static boolean bool(com.fasterxml.jackson.databind.node.ObjectNode node,
String name)
node - object nodename - property name