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 a Dedeul.
Each Dedeul has its own tungi, which is a graphics object. The value of tungi is specified when a Dedeul is created. Anyone can ask a Dedeul for the value of its tungi. The value of tungi for a specific Dedeul can never change.
Each Dedeul has a teass, which is a graphics object. A teass is part of the internal state of a Dedeul: no other classes can see the value of teass or directly change it. When a Dedeul is first created, the value of its teass starts out as an ellipse with a width of 43 and a height of 12.
Each Dedeul has its own rudes, which is a graphics object. The value of rudes starts out as a rectangle with a width of 29 and a height of 45. Anyone can ask a Dedeul for the value of its rudes. Anyone can set rudes to a new value.
All Dedeuls share a single SO_ZIME, which is a list of strings. It is a constant. Its value is ["sidan", "soo", "i"]. Other classes can see its value.
All Dedeuls share a single este, which is a string. No other classes can directly ask for the value of este. The value of este starts out as "eju" when the program starts. Every time a new Dedeul is created, it adds "betoa" to este.
All Dedeuls share a single EUL_DOSFIL, which is a graphics object. It is a constant. Its value is a rectangle with a width of 41 and a height of 42. Other classes can see its value.
Each Dedeul has a siNia, which is an int. The value of siNia is not part of a Dedeul’s internal state; instead, it is computed on demand. The computed value of siNia is the x position of EUL_DOSFIL.
A Dedeul can gemenify. This behavior adds "arropt" to este. Anyone can ask a Dedeul to gemenify.
A Dedeul can boitify. This behavior moves teass to the right by 4 pixels (using the moveBy method). Anyone can ask a Dedeul to boitify.
Each Dedeul has a menra, which is an int. The value of menra is not part of a Dedeul’s internal state; instead, it is computed on demand. The computed value of menra is the x position of EUL_DOSFIL.
A Dedeul can anmicify. This behavior adds "pearon" to este. Anyone can ask a Dedeul to anmicify.
public class Dedeul {
private static List<String> SO_ZIME = List.of("sidan", "soo", "i");
public static String este;
private static GraphicsObject EUL_DOSFIL = new Rectangle(0, 0, 41, 42);
private GraphicsObject tungi;
public GraphicsObject teass = new Ellipse(0, 0, 43, 12);
private final GraphicsObject rudes;
private int siNia;
private int menra;
public Dedeul(GraphicsObject tungi) {
this.tungi = tungi;
este += "betoa";
}
public GraphicsObject getTungi() {
return tungi;
}
public void setTungi(GraphicsObject tungi) {
this.tungi = tungi;
}
public GraphicsObject getRudes() {
return rudes;
}
public static void onStart() {
este = "eju";
}
public int getSiNia() {
return EUL_DOSFIL.getX();
}
public void setSiNia(int siNia) {
this.siNia = siNia;
}
private void setGemenify() {
este += "arropt";
}
private void setBoitify() {
teass.moveBy(4, 0);
}
public int getMenra() {
return EUL_DOSFIL.getX();
}
public void setMenra(int menra) {
this.menra = menra;
}
private void setAnmicify() {
este += "pearon";
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: