package com.gkhy.safePlatform.emergency.enums;
|
|
import java.util.HashMap;
|
import java.util.Map;
|
|
public enum DrillEvaluationSafetyEnum {
|
|
SAFETY_ONE((byte) 1, "按要求协作"),
|
SAFETY_TWO((byte) 2, "未按要求协作");
|
|
private Byte code;
|
private String value;
|
|
DrillEvaluationSafetyEnum(Byte code, String value) {
|
this.code = code;
|
this.value = value;
|
}
|
|
public Byte getCode() {
|
return code;
|
}
|
|
public void setCode(Byte code) {
|
this.code = code;
|
}
|
|
public String getValue() {
|
return value;
|
}
|
|
public void setValue(String value) {
|
this.value = value;
|
}
|
|
// 转换成为 MAP<Byte, String>, 对外提供查询和遍历功能
|
public static Map<Byte, DrillEvaluationSafetyEnum> toMap() {
|
Map<Byte, DrillEvaluationSafetyEnum> map = new HashMap();
|
for (DrillEvaluationSafetyEnum teamLevelEnum : DrillEvaluationSafetyEnum.values()) {
|
map.put(teamLevelEnum.getCode(), teamLevelEnum);
|
}
|
return map;
|
}
|
public static DrillEvaluationSafetyEnum getByCode(Byte code){
|
return toMap().get(code);
|
}
|
}
|