Translate the specification below into an idiomatic Java class definition.
(In this context, "idiomatic" means following the common style and conventions of the language.)
One kind of thing that exists in our model is an Esad.
Each Esad has its own rer, which is a list of strings. The value of rer is specified when a Esad is created. Anyone can ask an Esad for the value of its rer. The value of rer for a specific Esad can never change.
Each Esad has its own gesh, which is a string. The value of gesh starts out as "nial". Anyone can ask an Esad for the value of its gesh. Anyone can set gesh to a new value.
All Esads share a single HEHEL_TENE, which is a string. It is a constant. Its value is "rerduc". Other classes cannot see its value.
All Esads share a single eeSi, which is a list of strings. No other classes can directly ask for the value of eeSi. The value of eeSi starts out as an empty mutable list when the program starts. Every time a new Esad is created, it adds "id" to eeSi.
Each Esad has a veme, which is a string. A veme is part of the internal state of an Esad: no other classes can see the value of veme or directly change it. When an Esad is first created, the value of its veme starts out as "io".
An Esad can eianify. This behavior adds "sulbie" to gesh. Anyone can ask an Esad to eianify.
Each Esad has a susm, which is a string. The value of susm is not part of an Esad’s internal state; instead, it is computed on demand. The computed value of susm is HEHEL_TENE with two exclamation points appended.
Each Esad has a leScong, which is an int. The value of leScong is not part of an Esad’s internal state; instead, it is computed on demand. The computed value of leScong is the size of rer.
An Esad can gacate. This behavior adds "trou" to eeSi. Anyone can ask an Esad to gacate.
public class Esad {
public static String HEHEL_TENE = "rerduc";
public static List<String> eeSi;
private List<String> rer;
private final String gesh;
public String veme = "io";
private String susm;
private int leScong;
public Esad(List<String> rer) {
this.rer = rer;
eeSi.add("id");
}
public List<String> getRer() {
return rer;
}
public void setRer(List<String> rer) {
this.rer = rer;
}
public String getGesh() {
return gesh;
}
public static void onStart() {
eeSi = new ArrayList<>();
}
private void setEianify() {
gesh += "sulbie";
}
public String getSusm() {
return HEHEL_TENE + "!!";
}
public void setSusm(String susm) {
this.susm = susm;
}
public int getLeScong() {
return rer.size();
}
public void setLeScong(int leScong) {
this.leScong = leScong;
}
private void setGacate() {
eeSi.add("trou");
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: