Here's an example of my JSON:
{
"status": "ok",
"rowCount": 60,
"pageCount": 6,
"value": [{
"CustomerID": 1911,
"CustomerTypeID": 3,
...
}
]
}
My POJO:
@SerializedName("CustomerID")
public Integer CustomerID;
@SerializedName("CustomerTypeID")
public Integer CustomerTypeID;
I want to pull everything under value.
How do I do this using Google's GSON?
I've tried doing it as I would normally, but for, obvious reasons, it didn't work:
Type collectionType = new TypeToken<ArrayList<Customer>>() {}.getType();
return gson.fromJson(json, collectionType);
GsonBuilder gsonBuilder = new GsonBuilder(); gson = gsonBuilder.create(); ExampleClass resultObj = gson.fromJson(jsonObject.toString(), ExampleClass.class); List<Value> yourListOfCustomerValues = resultObj.getValue();