郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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;
    }
 
}