public class GsonJsonAdapter extends Object implements JsonAdapter
| Modifier and Type | Field and Description |
|---|---|
static String |
CLAZZ_NAME
类名
|
| Constructor and Description |
|---|
GsonJsonAdapter() |
GsonJsonAdapter(com.google.gson.Gson gson) |
GsonJsonAdapter(com.google.gson.GsonBuilder gsonBuilder) |
| Modifier and Type | Method and Description |
|---|---|
<T> List<T> |
readList(String json,
Class<T> clazz)
将 json 字符串转成对象
|
<T> T |
readValue(String json,
Class<T> clazz)
将 json 字符串转成对象
|
<T> T |
readValue(String json,
Type type)
将 json 字符串转成对象
|
String |
toJsonString(Object object)
转换成 json 字符串
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertValue, convertValue, readList, readValue, readValue, toJsonBytespublic static final String CLAZZ_NAME
public GsonJsonAdapter()
public GsonJsonAdapter(com.google.gson.Gson gson)
public GsonJsonAdapter(com.google.gson.GsonBuilder gsonBuilder)
public String toJsonString(Object object)
JsonAdaptertoJsonString in interface JsonAdapterobject - objectpublic <T> T readValue(String json, Class<T> clazz)
JsonAdapterreadValue in interface JsonAdapterT - 泛型json - jsonclazz - Classpublic <T> T readValue(String json, Type type)
JsonAdapterreadValue in interface JsonAdapterT - 泛型json - jsontype - Typepublic <T> List<T> readList(String json, Class<T> clazz)
JsonAdapterreadList in interface JsonAdapterT - 泛型json - jsonclazz - ClassCopyright © 2025. All rights reserved.