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 Camo.
Each Camo has its own banse, which is a list of strings. The value of banse is specified when a Camo is created. Anyone can ask a Camo for the value of its banse. The value of banse for a specific Camo can never change.
Each Camo has a meIal, which is a string. A meIal is part of the internal state of a Camo: no other classes can see the value of meIal or directly change it. When a Camo is first created, the value of its meIal starts out as "phumio".
Each Camo has its own schin, which is a graphics object. The value of schin is specified when a Camo is created. Anyone can ask a Camo for the value of its schin. Anyone can set schin to a new value.
All Camos share a single CUNG_SQIWRAS, which is a list of strings. It is a constant. Its value is ["kapra", "eia", "deroom"]. Other classes cannot see its value.
Each Camo has a feIokow, which is an int. The value of feIokow is not part of a Camo’s internal state; instead, it is computed on demand. The computed value of feIokow is the width of schin.
A Camo can hudidify. This behavior adds "esciss" to meIal. Anyone can ask a Camo to hudidify.
A Camo can issize. This behavior moves schin to the right by 3 pixels (using the moveBy method). Anyone can ask a Camo to issize.
public class Camo {
public static List<String> CUNG_SQIWRAS = List.of("kapra", "eia", "deroom");
private List<String> banse;
public String meIal = "phumio";
private final GraphicsObject schin;
private int feIokow;
public Camo(List<String> banse, GraphicsObject schin) {
this.banse = banse;
this.schin = schin;
}
public List<String> getBanse() {
return banse;
}
public void setBanse(List<String> banse) {
this.banse = banse;
}
public GraphicsObject getSchin() {
return schin;
}
public int getFeIokow() {
return schin.getWidth();
}
public void setFeIokow(int feIokow) {
this.feIokow = feIokow;
}
private void setHudidify() {
meIal += "esciss";
}
private void setIssize() {
schin.moveBy(3, 0);
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: