我有这个JSON:
{
"attributes": {
"date": "2016-01-01"
},
"first": "05:33",
"second": "05:50",
"third": "07:22"
}
通常我们使用Gson改造解析器来解析这个json:
Class MyObject {
@SerializedName("attributes")
Attribues attributes;
@SerializedName("first")
String first;
@SerializedName("second")
String second;
@SerializedName("third")
String third;
}
和
Class Attributes {
@SerializedName("date")
String date;
}
但我想做的是:
Class MyObject {
// I want date to be here and ignoring the attributes key <---
String date;
@SerializedName("first")
String first;
@SerializedName("second")
String second;
@SerializedName("third")
String third;
}
我们怎么做?