安装
方法一:
1.Android studio File->Settings..->Plugins–>Browse repositores..搜索GsonFormat
2.安装插件,重启android studio
方法二:
1.下载GsonFormat.jar ;
2.Android studio File->Settings..->Plugins –>install plugin from disk..导入下载GsonFormat.jar
3.重启android studio
使用方法
Alt + Insert 选择GsonFormat{
"sex": "男",
"age": 15,
"note": "弯的For",
}
生成结果是:
public class User {
/**
* sex : 男
* age : 15
* note : 弯的For
*/
private String sex;
private Integer age;
private String note;
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
}
个人感觉这个插件简直屌的不行