zhangf
2024-08-08 71706ced3375f4c18148516d0477d8fd645de2ee
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
package com.gkhy.huataiFourierSpecialGasMonitor.config.license;
 
import java.util.HashMap;
import java.util.Map;
 
public enum LicenseTypeEnum {
    INVALID((byte)0,"无效授权"),
    TRAIL((byte)1,"试用授权"),
    LIMIT((byte)2,"有限期授权"),
    LONG_TIME((byte)3,"长期有效授权")
    ;
 
    private Byte type;
    private String desc;
 
    LicenseTypeEnum(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, LicenseTypeEnum> map;
    static {
        map = new HashMap<>();
        for (LicenseTypeEnum typeEnum : LicenseTypeEnum.values()) {
            map.put(typeEnum.type,typeEnum);
        }
    }
    public static LicenseTypeEnum parse(Byte type) {
        return map.get(type);
    }
 
}