С сервера приходит ответ вида:
{
"error":false,
"lessons":[
{
"id":1,
"discipline":"??????????",
"group":"?11",
"group_id":31,
"subgroup":0,
"lecturer":"?????? ?.?.",
"lecturer_id":3,
"room":"305",
"offset":1,
"date":"2015-05-25",
"type":"LECTURE",
"number":0,
"comment":"no comments"
},
{
"id":2,
"discipline":"???. ??",
"group":"?11",
"group_id":31,
"subgroup":0,
"lecturer":"????????? ?.?.",
"lecturer_id":4,
"room":"406",
"offset":2,
"date":"2015-05-25",
"type":"LECTURE",
"number":0,
"comment":"no comments"
}
]
}
С парсингом "error" никаких проблем не возникает, но никак не получается парсить "lessons" в List.
Класс:
public class Lesson {
private long id;
private String discipline;
private long group_id;
private int subgroup;
private long lecturerr_id;
private String room;
private int offset;
private String date;
private String type;
private int number;
private String comment;
public Lesson() {
}
public Lesson(long id, String discipline, int subgroup, String room, int offset, String date, String type, int number, String comment) {
this.id = id;
this.discipline = discipline;
this.subgroup = subgroup;
this.room = room;
this.offset = offset;
this.date = date;
this.type = type;
this.number = number;
this.comment = comment;
this.lecturerr = lecturerr;
this.group = group;
}
//геттеры и сеттеры
@Override
public String toString() {
return "Lesson{" +
"id=" + id +
", discipline='" + discipline + '\'' +
", group_id=" + group_id +
", subgroup=" + subgroup +
", lecturerr_id=" + lecturerr_id +
", room='" + room + '\'' +
", offset=" + offset +
", date='" + date + '\'' +
", type='" + type + '\'' +
", number=" + number +
", comment='" + comment + '\'' +
", lecturerr=" + lecturerr +
", group=" + group +
'}';
}
}