我正在尝试解析以下动态键的Json字符串。
"report":{
"data":{
"results":{
"558952cca6d73d7d81c2eb9d":{
"Max":-1,
"Min":-1,
"Slope":-1,
},
"558ce148a6d73d7d81c2fa8a":{
"Max":-2,
"Min":-1,
"Slope":-2,
}
}
}
}
以下我正试图获取数据,但在解析最后一个动态的JSON字符串时出现错误。
public class Report {
@SerializedName("data")
@Expose
private Data data;
public Data getData() {
return data;
}
public void setData(Data data) {
this.data = data;
}
@Override
public String toString() {
return "Report{" +
"data=" + data +
'}';
}
}
public class Data {
@SerializedName("results")
@Expose
private ResultInside result;
public ResultInside getResult() {
return result;
}
public void setResult(ResultInside result) {
this.result = result;
}
}
public class ResultInside {
/*@SerializedName("results")
@Expose*/
private Map<String, Vitals> elemDetails = new HashMap<>();
public Map<String, Vitals> getElemDetails() {
return elemDetails;
}
public void setElemDetails(Map<String, Vitals> elemDetails) {
this.elemDetails = elemDetails;
}
}
任何建议如何在这种情况下进行解析!