import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
public class TestJackson {
public static void main(String[] args) throws IOException {
ObjectMapper mapper = new ObjectMapper();
String testJson = "{
" + " "user": {
" + " "0": {
" + " "firstName": "Monica",
" + " "lastName": "Belluci"
" + " },
" + " "1": {
" + " "firstName": "John",
" + " "lastName": "Smith"
" + " },
" + " "2": {
" + " "firstName": "Owen",
" + " "lastName": "Hargreaves"
" + " }
" + " }
" + "}";
User readValue = mapper.readValue(testJson, User.class);
System.out.println("readValue = " + readValue);
}
}