I have a below JSON document in which items
is an array which will contain multiple item
objects. And each item
object has many fields as shown below. For simplicity purpose, I am showing only one item
object in an items
array but it can have more.
{
"items": [{
"createDate": 1234567890,
"title": "some title",
"bp": {
"currencyId": "USD",
"value": 10.0
},
"pof": false,
"ku": true,
"var": {
"quant": 10,
"tot": 0,
"co": 1,
"vbp": {
"cid": "USD",
"val": 10.0
},
"id": 5296164,
"sel": {
"style": "Short",
"Size": "L",
"Color": "Blue"
}
},
"flags": {
"low": false,
"rpl": false,
"scmb": false
}
"shipping": {
"shippingType": "sss"
},
"seller": {
"name": "",
"sco": 0,
"perc": 0.0,
"id": 101215,
"brand": true,
"prog": "NONE"
},
"dur": "DA9",
"urls": ["world", "hello"],
"itemId": 1234
}
],
"count": {
"ac": 3,
"ed": 0
}
}
How can I parse my above JSON into a POJO using Gson? I am confused because it has lot of JSON object fields in it so not able to understand how to make a class which can hold all those things.