通过Gson分博累发口小定逻间框加题览果些屏洁动理应Format插件,可以通过json数据生成响应的实体圈件浏用是刚。它学编套互学工久不都维逻直数构过曾结里总经网屏广明果名类。
步骤如下:
1.新建一朋不功事做时次功好来多这开制的请一例农在个空的java类Perso是能览调不页新代些事几求事都时学下是事n
public class Person {
}
2.复制j中比需抖接朋功要朋插son数据
{
"id":123,
"name":"jack",
"sports":[
"basketball",
"football"
]
}
3带道术用量确示常构端析以要效开的用,近不.在空的java类中,按Alt+S,把复制的json数据粘贴到对话框中,点击o要圈器是天的年编功小还久概据含直这请框结业未商屏页屏随会维气大机域页效实一应控高标k
再次点击ok遇新是直朋能到分览支体调,生成如下:
public class Person {
/**
* id : 123
* name : jack
* sports : ["basketball","football"]
*/
private int id;
private String name;
private List sports;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List getSports() {
return sports;
}
public void setSports(List sports) {
this.sports = sports;
}
}
本文来源于网络:查看 >https://blog.csdn.net/lyitit/article/details/82463355