public final class JsonUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static com.jayway.jsonpath.ReadContext |
fromJson(String json)
Converts a given Json string to an JSONPath ReadContext
|
static <T extends Collection<C>,C> |
fromJson(String json,
Class<C> componentType,
Class<T> clazz)
Converts a given Json string to a collection of a given Class
|
static <T> T |
fromJson(String json,
Class<T> clazz)
Converts a given Json string to given Class
|
static String |
toJson(Object object)
Converts a given object to a Json string
|
static void |
withJsonSerializer(io.advantageous.boon.json.JsonSerializer serializer)
Sets a new custom JsonSerializer
|
public static void withJsonSerializer(io.advantageous.boon.json.JsonSerializer serializer)
serializer - The JsonSerializer to setpublic static String toJson(Object object)
object - The object to convertpublic static com.jayway.jsonpath.ReadContext fromJson(String json)
json - The json string to convertpublic static <T> T fromJson(String json, Class<T> clazz)
T - JavaDoc wants this, just ignore itjson - The json string to convertclazz - The Class to convert topublic static <T extends Collection<C>,C> T fromJson(String json, Class<C> componentType, Class<T> clazz)
T - JavaDoc wants this, just ignore itC - JavaDoc wants this, just ignore itjson - The json string to convertcomponentType - The collection type to convert toclazz - The Class to convert toCopyright © 2016. All rights reserved.