Here is the example json.
{
"foo1" : "...",
"foo2" : "...",
"foo3" : "...",
"foo4" : "..."
}
I want to deserialize it like this.
class Response {
List<Foo> foos;
}
I tried this, but not worked.
class Response {
...
@JsonProperty("foo\\d")
private void collect(String bar) {
foos.add(bar);
}
}
This worked. but I want to more simple thing.
@JsonProperty("foo1")
private void collect1(String bar) {
foos.add(bar);
}
@JsonProperty("foo2")
private void collect2(String bar) {
foos.add(bar);
}
.
.
.