| Constructor and Description |
|---|
JsonConverter(String responseType) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
fromJson(Map<?,?> json,
Class<T> clazz)
把JSON格式的数据转换为对象。
|
String |
getResponseType() |
void |
setResponseType(String responseType) |
<T> T |
toResponse(String rsp,
Class<T> clazz)
把字符串转换为响应对象。
|
public JsonConverter(String responseType)
public <T> T toResponse(String rsp, Class<T> clazz) throws ApiException
ConvertertoResponse in interface ConverterT - 领域泛型rsp - 响应字符串clazz - 领域类型ApiExceptionpublic <T> T fromJson(Map<?,?> json, Class<T> clazz) throws ApiException
T - 泛型领域对象json - JSON格式的数据clazz - 泛型领域类型ApiExceptionpublic String getResponseType()
public void setResponseType(String responseType)
Copyright © 2021. All rights reserved.