-2
I am migrating a desktop application in Delphi to java, and in Delphi there is a class that persists in the database the values 00, 10, 20 and 30. I’m making a java Enum to persist the values. I know that, by annotation, you have to define the strategies of string and ordinal , but none of them suits me.
What I have so far.
public enum Tipo {
tipo("00"),
tipo1("10"),
tipo2("20"),
tipo3("30");
String valor;
private Tipo(String valor) {
this.valor=valor;
}
public String getValor() {
return valor;
}
}
I wonder if I’m in the way or if there’s a better way to create this Enum?
Do not add code image, add code in text. Recommended reading: Manual on how NOT to ask questions
– user28595