IDEA is used GsonFormat

Version: IDEA Community 2019.2.2

Description: GsonFormat is a Json objects can be directly converted into Java classes plugin

Process: mounting plug GsonFormat = "Create a new empty class = Book" in the generated class alt + s, the pop-up box json input object, such as { "id": 1, "name": "Three Kingdoms"} = " OK

= "Is generated following:

public class Book {

/**
* id : 1
* name : 三国演义
*/

private int id;
private String name;

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;
}
}

Guess you like

Origin www.cnblogs.com/maycpou/p/11568367.html