I have some json code like this:
{
"First name": "David",
"Last name": "Esseiva"
}
and I want to map it with my java class. But normally we cannot create properties in java class like this:
class Name{
String first name;
String last name;
}
If we create like this:
class Name{
String first_name;
String last_name;
}
Is it possible to let it map together?
So, I want to know what is a possible way to map these together?
Yup, Gson is what you are looking for
http://code.google.com/p/google-gson/
In your case, you would do something like this
and it will do all the serializing for you 🙂