public final class JsonHelper extends Object
Constructor and Description |
---|
JsonHelper() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
getAsType(com.fasterxml.jackson.databind.JsonNode node,
Class<T> clazz)
Return an Object from a JSON node.
|
static Object |
getElement(com.fasterxml.jackson.databind.JsonNode json,
String name)
Return the field with name in JSON as a string, a boolean, a number or a node.
|
static com.fasterxml.jackson.databind.JsonNode |
getFirstNode(String text)
Return the first node of a JSON response.
|
static String |
toJSONString(Object obj)
Returns the JSON string for the object.
|
public static com.fasterxml.jackson.databind.JsonNode getFirstNode(String text)
text
- JSON textpublic static <T> T getAsType(com.fasterxml.jackson.databind.JsonNode node, Class<T> clazz)
T
- the class to cast tonode
- a JSON nodeclazz
- the class to cast topublic static Object getElement(com.fasterxml.jackson.databind.JsonNode json, String name)
json
- jsonname
- node nameCopyright © 2016. All rights reserved.