I have the following API response:
{
"data":{
"categoryFields":[
{
"name":"brand",
"label":"Marca",
"values":[
{
"key":53,
"value":"Alfa Romeo"
},
{
"key":55,
"value":"Audi"
}
]
},
{
"name":"year",
"label":"Año", ,
"dataType":"select",
"values":[
{
"key":2017,
"value":2017
},
{
"key":2016,
"value":2016
}
]
},
]
}
}
Ok, in the first categoryField
the values are:
"key":53 INT,
"value":"Alfa Romeo", STRING
In the second categoryField
the values are:
"key":2017, INT
"value":2017, INT
Also there's another type:
"key":"string", STRING
"value":"String", STRING
I need a class that can handle those types of data. Something like:
public class Value {
@SerializedName("key")
@Expose
private DYNAMIC_TYPE key;
@SerializedName("value")
@Expose
private DYNAMIC_TYPE value;
}
How can I do that? Or there's a Gson function to help me with that?