Class JsonUtil
- java.lang.Object
-
- com.flowable.platform.common.util.JsonUtil
-
public class JsonUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidalwaysSet(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.node.ObjectNode jsonNode, String fieldName, Object value)static com.fasterxml.jackson.databind.JsonNodeasNode(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Object value)static com.fasterxml.jackson.databind.node.ArrayNodeconvertToArrayNode(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Collection<Object> valueList)static com.fasterxml.jackson.databind.node.ArrayNodeconvertToArrayNode(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Set<String> ids)static BooleangetBoolean(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)static booleangetBoolean(com.fasterxml.jackson.databind.JsonNode jsonNode, String field, boolean defaultValue)static DategetDate(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)static InstantgetInstant(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)static IntegergetInteger(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)static intgetInteger(com.fasterxml.jackson.databind.JsonNode jsonNode, String field, int defaultValue)static StringgetIso8601String(Date input)static <T> List<T>getListFromArrayNode(com.fasterxml.jackson.databind.JsonNode node, String field, Function<com.fasterxml.jackson.databind.JsonNode,T> extractor)static <T> List<T>getListFromArrayNode(com.fasterxml.jackson.databind.node.ArrayNode target, Function<com.fasterxml.jackson.databind.JsonNode,T> extractor)static LonggetLong(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)static LonggetLong(com.fasterxml.jackson.databind.JsonNode jsonNode, String field, long defaultValue)static ObjectgetRawValue(com.fasterxml.jackson.databind.JsonNode jsonNode)static <T> Set<T>getSetFromArrayNode(com.fasterxml.jackson.databind.JsonNode node, String field, Function<com.fasterxml.jackson.databind.JsonNode,T> extractor)static StringgetString(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)static StringgetString(com.fasterxml.jackson.databind.JsonNode jsonNode, String field, String defaultValue)static StringnullSafeGetDate(Date date)static voidnullSafeSet(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.node.ObjectNode jsonNode, String fieldName, Object value)static voidnullSafeSet(Map<String,Object> mapNode, String fieldName, Object value)static voidnullSafeSetIfNotSet(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.node.ObjectNode jsonNode, String fieldName, Object value)
-
-
-
Method Detail
-
alwaysSet
public static void alwaysSet(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.node.ObjectNode jsonNode, String fieldName, Object value)
-
nullSafeSet
public static void nullSafeSet(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.node.ObjectNode jsonNode, String fieldName, Object value)
-
nullSafeSetIfNotSet
public static void nullSafeSetIfNotSet(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.node.ObjectNode jsonNode, String fieldName, Object value)
-
nullSafeSet
public static void nullSafeSet(Map<String,Object> mapNode, String fieldName, Object value)
-
convertToArrayNode
public static com.fasterxml.jackson.databind.node.ArrayNode convertToArrayNode(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Set<String> ids)
-
asNode
public static com.fasterxml.jackson.databind.JsonNode asNode(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Object value)
-
convertToArrayNode
public static com.fasterxml.jackson.databind.node.ArrayNode convertToArrayNode(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Collection<Object> valueList)
-
getRawValue
public static Object getRawValue(com.fasterxml.jackson.databind.JsonNode jsonNode)
-
getString
public static String getString(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)
-
getString
public static String getString(com.fasterxml.jackson.databind.JsonNode jsonNode, String field, String defaultValue)
-
getInteger
public static Integer getInteger(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)
-
getInteger
public static int getInteger(com.fasterxml.jackson.databind.JsonNode jsonNode, String field, int defaultValue)
-
getLong
public static Long getLong(com.fasterxml.jackson.databind.JsonNode jsonNode, String field, long defaultValue)
-
getInstant
public static Instant getInstant(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)
-
getBoolean
public static Boolean getBoolean(com.fasterxml.jackson.databind.JsonNode jsonNode, String field)
-
getBoolean
public static boolean getBoolean(com.fasterxml.jackson.databind.JsonNode jsonNode, String field, boolean defaultValue)
-
getListFromArrayNode
public static <T> List<T> getListFromArrayNode(com.fasterxml.jackson.databind.JsonNode node, String field, Function<com.fasterxml.jackson.databind.JsonNode,T> extractor)
-
getListFromArrayNode
public static <T> List<T> getListFromArrayNode(com.fasterxml.jackson.databind.node.ArrayNode target, Function<com.fasterxml.jackson.databind.JsonNode,T> extractor)
-
-