I have a class POJO
Class Pojo {
String id;
String name;
//getter and setter
}
I have a json like
{
"response" : [
{
"id" : "1a",
"name" : "foo"
},
{
"id" : "1b",
"name" : "bar"
}
]
}
I am using Jackson ObjectMapper for deserialization. How can I get List<Pojo>
without creating any other parent class?
If it is not possible, is it possible to get Pojo
object which holds just first element of json string i.e. in this case id="1a"
and name="foo"
?