I know similar questions have been asked before, but they did not resolve my particular scenario.
I am using jackson to bind json to pojo object. The problem is that the Json result will sometimes be a single value:
attributes: [
{
name: "IDs",
value: [
76715
]
},
{
name: "Updated",
value: false
},
{
name: "Merged",
value: false
},
{
name: "Source",
value: "db"
}
]
My question is, how do I account for this in my attribute object?
I tried string, then tried an array then tried to combine them.
private List value = new ArrayList();
public List getValue() {
return value;
}
public void setValue(List value) {
this.value = value;
}
public void setValue(String value) {
this.value.add(value);
}
So far nothing has worked for all the possibilities for "value".