public final class JsonUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static com.fasterxml.jackson.databind.node.ArrayNode |
arrayNode() |
static BigDecimal |
bigDecimalProperty(com.fasterxml.jackson.databind.JsonNode node,
String propertyName)
Extract a BigDecimal property from the given json tree.
|
static void |
bigDecimalProperty(com.fasterxml.jackson.databind.node.ObjectNode node,
String propertyName,
BigDecimal propertyValue)
Sets the value of a property for a given json node.
|
static Boolean |
booleanProperty(com.fasterxml.jackson.databind.JsonNode node,
String propertyName)
Extract a boolean property from the given json tree.
|
static void |
booleanProperty(com.fasterxml.jackson.databind.node.ObjectNode node,
String propertyName,
Boolean propertyValue)
Sets the value of a property for a given json node.
|
static <E extends Enum<E>> |
enumProperty(com.fasterxml.jackson.databind.node.ObjectNode node,
String propertyName,
E propertyValue)
Sets the value of a property for a given json node.
|
static Integer |
intProperty(com.fasterxml.jackson.databind.JsonNode node,
String propertyName)
Extract a integer property from the given json tree.
|
static void |
intProperty(com.fasterxml.jackson.databind.node.ObjectNode node,
String propertyName,
Integer propertyValue)
Sets the value of a property for a given json node.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
objectNode() |
static String |
stringProperty(com.fasterxml.jackson.databind.JsonNode node,
String propertyName)
Extract a string property from the given json tree.
|
static void |
stringProperty(com.fasterxml.jackson.databind.node.ObjectNode node,
String propertyName,
String propertyValue)
Sets the value of a property for a given json node.
|
public static com.fasterxml.jackson.databind.node.ObjectNode objectNode()
public static com.fasterxml.jackson.databind.node.ArrayNode arrayNode()
public static String stringProperty(com.fasterxml.jackson.databind.JsonNode node, String propertyName)
node - JsonNodepropertyName - Property to extractpublic static void stringProperty(com.fasterxml.jackson.databind.node.ObjectNode node,
String propertyName,
String propertyValue)
node - ObjectNodepropertyName - Property to be setpropertyValue - Value to be setpublic static <E extends Enum<E>> void enumProperty(com.fasterxml.jackson.databind.node.ObjectNode node, String propertyName, E propertyValue)
E - Type of the property valuenode - ObjectNodepropertyName - Property to be setpropertyValue - Value to be setpublic static Boolean booleanProperty(com.fasterxml.jackson.databind.JsonNode node, String propertyName)
node - JsonNodepropertyName - Property to extractpublic static void booleanProperty(com.fasterxml.jackson.databind.node.ObjectNode node,
String propertyName,
Boolean propertyValue)
node - ObjectNodepropertyName - Property to be setpropertyValue - Boolean value to be setpublic static Integer intProperty(com.fasterxml.jackson.databind.JsonNode node, String propertyName)
node - JsonNodepropertyName - Property to extractpublic static void intProperty(com.fasterxml.jackson.databind.node.ObjectNode node,
String propertyName,
Integer propertyValue)
node - ObjectNodepropertyName - Property to be setpropertyValue - Integer value to be setpublic static BigDecimal bigDecimalProperty(com.fasterxml.jackson.databind.JsonNode node, String propertyName)
node - JsonNodepropertyName - Property to extractpublic static void bigDecimalProperty(com.fasterxml.jackson.databind.node.ObjectNode node,
String propertyName,
BigDecimal propertyValue)
node - ObjectNodepropertyName - Property to be setpropertyValue - BigDecimal value to be setCopyright © 2019. All rights reserved.