2023-10-16 16:38:12 +02:00
|
|
|
package eu.eudat.commons.enums;
|
|
|
|
|
|
|
|
import eu.eudat.data.converters.enums.DatabaseEnum;
|
|
|
|
|
2023-10-17 11:39:29 +02:00
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
|
2023-10-16 16:38:12 +02:00
|
|
|
public enum Status implements DatabaseEnum<Integer> {
|
|
|
|
|
|
|
|
Inactive(0),
|
|
|
|
Active( 1);
|
|
|
|
|
|
|
|
private final Integer value;
|
|
|
|
|
|
|
|
Status(Integer value) {
|
|
|
|
this.value = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Integer getValue() {
|
|
|
|
return value;
|
|
|
|
}
|
2023-10-17 11:39:29 +02:00
|
|
|
|
|
|
|
private static final Map<Integer, Status> map;
|
|
|
|
static {
|
|
|
|
map = new HashMap<>();
|
|
|
|
for (Status v : Status.values()) {
|
|
|
|
map.put(v.getValue(), v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Status of(Integer i) {
|
|
|
|
return map.get(i);
|
|
|
|
}
|
|
|
|
|
2023-10-16 16:38:12 +02:00
|
|
|
}
|