I face the next problem:
I have properties on BE side, which I can get and set via handler. I use enum to set properties, and bean class to get. Now I need to duplicate properties names, I want to avoid it.
public enum ExampleEnum {
APPLE("_apple"),
PEAR("_pear"),
PINEAPPLE("_pineapple");
private final String name;
ExampleEnum(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
}
@Data
@With
@AllArgsConstructor
public class EnumBean {
@SerializedName("_apple")
String apple;
@SerializedName("_pear")
String pear;
@SerializedName("_pineapple")
String pineapple;
}
public interface PropertiesService {
EnumBean getPropertiesViaBE();
void setPropertyViaBE(ExampleEnum property, String value);
}
Now I have to support consistency in both ways between these classes.