Good morning,
I am struggling to use GSON to parse some JSON output from a particular web service. Here is some sample output:
[
{
"count": 1,
"headings": [
"name",
"hosts",
"Model",
],
"kind": "Cluster",
"offset": 0,
"results": [
[
"cluster1",
[
"host1",
"host2"
],
[
"Virtual Machine",
"Virtual Machine"
]
]
]
}
]
The "results" portion is the part I am having trouble processing. Basically since the results have mixed types, Lists and strings, I can't write an object that represents it. I've been reading that this may require a deserializer. I am slightly out of my depth on this and would appreciate any insight into how to solve this.
My classes that I am currently using looks like this:
public class ModelDefinition
{
public Integer count ;
public ArrayList<String> headings ;
public String kind ;
public Integer next_offset ;
public Integer offset ;
public String results_id ;
public String next ;
}
public class LongModelDefinition extends ModelDefinition
{
public ArrayList<String[][]> results ;
}
I understand why it isn't working, but I'm not sure how to fix it.