package com.gk.hotwork.specialWork.enums;
|
|
import java.util.HashMap;
|
import java.util.Map;
|
|
public enum WorkStandTypeEnum {
|
TYPE_COMBUSTIBLE_GAS((byte) 1,"可燃气"),
|
TYPE_OXYGEN((byte) 2,"氧气"),
|
TYPE_HARMFUL((byte)3,"有毒有害气体"),
|
|
|
;
|
|
private Byte type;
|
private String desc;
|
|
WorkStandTypeEnum(Byte type, String desc) {
|
this.type = type;
|
this.desc = desc;
|
}
|
|
public Byte getType() {
|
return type;
|
}
|
|
public void setType(Byte type) {
|
this.type = type;
|
}
|
|
public String getDesc() {
|
return desc;
|
}
|
|
public void setDesc(String desc) {
|
this.desc = desc;
|
}
|
|
|
static Map<Byte, WorkStandTypeEnum> map;
|
static {
|
map = new HashMap<>();
|
for (WorkStandTypeEnum standTypeEnum : WorkStandTypeEnum.values()) {
|
map.put(standTypeEnum.getType(), standTypeEnum);
|
}
|
}
|
|
|
public static WorkStandTypeEnum parse(Byte code) {
|
return map.get(code);
|
}
|
|
|
|
public static boolean checkWorkStandType(Byte type){
|
boolean flag = false;
|
for (WorkStandTypeEnum workStandTypeEnum : WorkStandTypeEnum.values()){
|
if(workStandTypeEnum.getType().equals(type)){
|
flag = true;
|
}
|
}
|
return flag;
|
}
|
|
}
|