public class JsonUtil
Type Params | Return Type | Name and description |
---|---|---|
<T> |
public static T |
fromJson(String json, Type typeOfT) Convert JSON string to Object |
<T> |
public static T |
fromJson(Reader reader, Type typeOfT) |
<T> |
public static T |
fromJson(Reader reader, Class<T> classOfT) |
<T> |
public static T |
fromJson(String json, Class<T> classOfT) Convert JSON string to Object |
|
public static void |
mergeJsonObject(JsonObject src, JsonObject dst) |
|
public static String |
toJson(Object src) Convert an object to JSON string. |
|
public static String |
toJson(Object src, boolean prettyPrint) Convert an object to JSON string. |
|
public static String |
toJson(Object src, Type typeOfSrc) Convert an object to JSON string. |
|
public static String |
toJson(Object src, Type typeOfSrc, boolean prettyPrint) Convert an object to JSON string. |
|
public static JsonObject |
toJsonObject(Object src) |
Convert JSON string to Object
json
- JSON stringtypeOfT
- type of target objectConvert JSON string to Object
json
- JSON stringclassOfT
- class of target objectConvert an object to JSON string. Pretty print by default.
src
- source objectConvert an object to JSON string.
src
- source objectprettyPrint
- pretty printConvert an object to JSON string. Pretty print by default.
src
- source objecttypeOfSrc
- type of sourceConvert an object to JSON string.
src
- source objecttypeOfSrc
- type of sourceprettyPrint
- pretty print