我必须使用 API RESTful Web 服务。目前我必须处理一个 JSON 对象,它看起来像:
{
"success":true,
"error":"",
"message":"",
"data":[
["USD","US Dollar","11,696", "connected"],
["EUR","Euro","10,733","connected"]
]
}
这是我通常用来保存此 Web 服务的大多数端点的类:
public class Response {
public boolean success;
private String error;
private String message;
private List<Map<Integer, Array>> data;
public String getError() {
return this.error;
}
public String getMessage() {
return this.message;
}
public Map<Integer,Array> getData() {
return this.data.get(0);
}
}
运行时,应用程序崩溃:
Could not read JSON: Can not deserialize instance of java.util.LinkedHashMap
out of START_ARRAY token