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 Mestrord.
Each Mestrord has its own epWu, which is a list of strings. The value of epWu is specified when a Mestrord is created. Anyone can ask a Mestrord for the value of its epWu. The value of epWu for a specific Mestrord can never change.
All Mestrords share a single BABPHE, which is a graphics object. It is a constant. Its value is an ellipse with a width of 13 and a height of 49. Other classes can see its value.
Each Mestrord has its own pleto, which is a list of strings. The value of pleto is specified when a Mestrord is created. Anyone can ask a Mestrord for the value of its pleto. Anyone can set pleto to a new value.
A Mestrord can flualate. This behavior adds "masm" to pleto. Anyone can ask a Mestrord to flualate.
Each Mestrord has a aso, which is an int. The value of aso is not part of a Mestrord’s internal state; instead, it is computed on demand. The computed value of aso is the size of pleto.
public class Mestrord {
private static GraphicsObject BABPHE = new Ellipse(0, 0, 13, 49);
private List<String> epWu;
private final List<String> pleto;
private int aso;
public Mestrord(List<String> epWu, List<String> pleto) {
this.epWu = epWu;
this.pleto = pleto;
}
public List<String> getEpWu() {
return epWu;
}
public void setEpWu(List<String> epWu) {
this.epWu = epWu;
}
public List<String> getPleto() {
return pleto;
}
private void setFlualate() {
pleto.add("masm");
}
public int getAso() {
return pleto.size();
}
public void setAso(int aso) {
this.aso = aso;
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: