public class JsonTool
extends java.lang.Object
Created by sergeych on 12.04.16.
| Constructor and Description |
|---|
JsonTool() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
fromJson(com.eclipsesource.json.JsonValue jsonValue) |
static <T> T |
fromJson(java.lang.String jsonString) |
static <T extends com.eclipsesource.json.JsonValue> |
toJson(java.lang.Object object)
Deep convert any suitable Java object to corresponding
JsonValue derivative. |
static java.lang.String |
toJsonString(java.lang.Object value)
Deep convert to JSON and return it's string representation.
|
public static <T extends com.eclipsesource.json.JsonValue> T toJson(java.lang.Object object)
JsonValue derivative. Converts
collections, arrays, maps in depth, converting all containing objects. Note that the map keys
are always converted to strings.
object - object to convertjava.lang.IllegalArgumentException - if there is no known way to convert the object to JSONpublic static java.lang.String toJsonString(java.lang.Object value)
value - object to convert. Anything that could be converted to JSON.public static <T> T fromJson(com.eclipsesource.json.JsonValue jsonValue)
public static <T> T fromJson(java.lang.String jsonString)