JSON GSON.fromJson Java Objects
我正在尝试将我的 Json 加载到我的类中
public User() {
this.fbId = 0;
this.email = "";
this.name = "";
this.thumb = "";
this.gender = "";
this.location = "";
this.relationship = null;
this.friends = new ArrayList();
}
{
users:{
user:{
name:'the name',
email:'some@email.com',
friends:{
user:{
name:'another name',
email:'this@email.com',
friends:{
user:{
name:'yet another name',
email:'another@email.com'
}
}
}
}
}
}
}
我正在努力让GSON使用以下代码将用户详细信息加载到上面的Java对象中
User user = gson.fromJson(this.json, User.class);