我的 json 看起来像:
[
{
"schedule":[
{
"amount":19.98,
"due_at":null,
"identifier":"1549b45ff814e181dcbb983a02b35e9b3dd276fc-1",
"paid_at":"2012-01-24",
"status":"paid"
}
]
},
{
"schedule":[
{
"amount":24.68,
"due_at":null,
"identifier":"1549fdfdf814e181dcbb983a02b35e9b3dd276fc-1",
"paid_at":"2012-08-14",
"status":"paid"
}
]
}
]
我的日程表模型:
public class Schedule {
public double amount;
public String due_at;
public String identifier;
public String paid_at;
public String status;
}
我的时间表模型:
public class Schedules extends HashMap<String, ArrayList<Schedule>>{
private static final long serialVersionUID = 1L;
}
现在我使用:
ListSchedules objectMapper.readValue = (jp, new TypeReference <Schedules> () {});
但它不起作用,谁能告诉我要走的路