Trying to learn how to use JSON and parse the json data.i am using google-gson API to parse my json data.
i am getting my JSON data in the following format
{"guid":{"uri":"http://social.yahooapis.com/v1/me/guid","value":"123456789"}}
and here is my parsing code using google-gson
Gson gson=new Gson();
MyGuid myGuid=new MyGuid();
myGuid=gson.fromJson(response.getBody(), MyGuid.class);
public class MyGuid {
public MyGuid() {
}
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
but i am getting the value of guid as null. I know i am doing wrong but being new to JSON format is what making me more confused.
Any help in this regard will be helpful.
MyGuidclass (except getters/setters).