44 lines
1.1 KiB
Java
44 lines
1.1 KiB
Java
package eu.eudat.commons.enums;
|
|
|
|
public enum DescriptionTemplateTypeStatus {
|
|
|
|
SAVED((short) 0), FINALIZED((short) 1), DELETED((short) 99);
|
|
|
|
private final short value;
|
|
|
|
DescriptionTemplateTypeStatus(short value) {
|
|
this.value = value;
|
|
}
|
|
|
|
public short getValue() {
|
|
return value;
|
|
}
|
|
|
|
public static DescriptionTemplateTypeStatus fromInteger(int value) {
|
|
switch (value) {
|
|
case 0:
|
|
return SAVED;
|
|
case 1:
|
|
return FINALIZED;
|
|
case 99:
|
|
return DELETED;
|
|
default:
|
|
throw new RuntimeException("Unsupported Description Template Type Status");
|
|
}
|
|
}
|
|
|
|
public static DescriptionTemplateTypeStatus fromLabel(String value) {
|
|
switch (value) {
|
|
case "SAVED":
|
|
return SAVED;
|
|
case "FINALISED":
|
|
return FINALIZED;
|
|
case "DELETED":
|
|
return DELETED;
|
|
default:
|
|
throw new RuntimeException("Unsupported Description Template Type Status");
|
|
}
|
|
}
|
|
|
|
}
|