public class GsonUtils extends Object
| 构造器和说明 |
|---|
GsonUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
fromJson(com.google.gson.JsonElement jsonElement,
Class<T> tClass)
From json t.
|
<T> T |
fromJson(String json,
Class<T> tClass)
From json t.
|
<T> List<T> |
fromList(String json,
Class<T> clazz)
From list list.
|
static com.google.gson.Gson |
getGson()
Gets gson instance.
|
static GsonUtils |
getInstance()
Gets instance.
|
String |
toJson(Object object)
To json string.
|
List<Map<String,Object>> |
toListMap(String json)
toList Map.
|
Map<String,Object> |
toObjectMap(String json)
To object map map.
|
ConcurrentSkipListMap<String,Object> |
toTreeMap(String json)
To tree map tree map.
|
public static com.google.gson.Gson getGson()
public static GsonUtils getInstance()
public <T> T fromJson(String json, Class<T> tClass)
T - the type parameterjson - the jsontClass - the t classpublic <T> T fromJson(com.google.gson.JsonElement jsonElement,
Class<T> tClass)
T - the type parameterjsonElement - the json elementtClass - the t classpublic <T> List<T> fromList(String json, Class<T> clazz)
T - the type parameterjson - the jsonclazz - the clazzpublic List<Map<String,Object>> toListMap(String json)
json - jsonpublic Map<String,Object> toObjectMap(String json)
json - the jsonpublic ConcurrentSkipListMap<String,Object> toTreeMap(String json)
json - the jsonCopyright © 2020 dromara. All rights reserved.