public class JsonUtils extends Object
| Constructor and Description |
|---|
JsonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
fromJson(String json,
Class<T> T)
From json.
|
static com.google.gson.Gson |
getGson()
Initializes the current Gson object if null and returns it.
|
static String |
toJson(Object src)
To json.
|
public static com.google.gson.Gson getGson()
public static <T> T fromJson(String json, Class<T> T)
T - the generic typejson - the string from which the object is to be deserialized.T - the type of the desired object.Gson.fromJson(String, Class)Copyright © 2017 BotMill. All rights reserved.