public class JsonUtil extends Object
| 构造器和说明 |
|---|
JsonUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static JsonAdapter |
getJsonAdapter()
获取 jsonAdapter
|
static JsonAdapter |
getJsonAdapter(JsonAdapter jsonAdapter)
获取 jsonAdapter
|
static <T> List<T> |
readList(String json,
Class<T> clazz)
将 json 字符串转成对象
|
static <T> T |
readValue(String json,
Class<T> clazz)
将 json 字符串转成对象
|
static String |
toJsonString(Object object)
转换成 json 字符串
|
public static JsonAdapter getJsonAdapter()
public static JsonAdapter getJsonAdapter(JsonAdapter jsonAdapter)
jsonAdapter - JsonAdapterpublic static String toJsonString(Object object)
object - objectpublic static <T> T readValue(String json, Class<T> clazz)
T - 泛型json - jsonclazz - ClassCopyright © 2023. All rights reserved.