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 FioBapre.
All FioBapres share a single EULULUSTDUNT, which is a list of strings. It is a constant. Its value is ["dicont", "isci"]. Other classes cannot see its value.
Each FioBapre has its own spo, which is a graphics object. The value of spo is specified when a FioBapre is created. Anyone can ask a FioBapre for the value of its spo. The value of spo for a specific FioBapre can never change.
Each FioBapre has its own eou, which is a graphics object. The value of eou starts out as an ellipse with a width of 32 and a height of 34. Anyone can ask a FioBapre for the value of its eou. Anyone can set eou to a new value.
Each FioBapre has a tiarn, which is an int. The value of tiarn is not part of a FioBapre’s internal state; instead, it is computed on demand. The computed value of tiarn is the size of EULULUSTDUNT.
A FioBapre can teusate. This behavior moves eou to the right by 4 pixels (using the moveBy method). Anyone can ask a FioBapre to teusate.
public class FioBapre {
public static List<String> EU_LU_LUSTDUNT = List.of("dicont", "isci");
private GraphicsObject spo;
private final GraphicsObject eou;
private int tiarn;
public FioBapre(GraphicsObject spo) {
this.spo = spo;
}
public GraphicsObject getSpo() {
return spo;
}
public void setSpo(GraphicsObject spo) {
this.spo = spo;
}
public GraphicsObject getEou() {
return eou;
}
public int getTiarn() {
return EU_LU_LUSTDUNT.size();
}
public void setTiarn(int tiarn) {
this.tiarn = tiarn;
}
private void setTeusate() {
eou.moveBy(4, 0);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: