“djh”
2024-12-05 eee41a5fb58e6547a43929430f4b72908119db6e
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
package com.gkhy.testFourierSpecialGasMonitor.domain.sysAdmin.enums;
 
import java.util.HashMap;
import java.util.Map;
 
public enum MenuItemTypeEnum {
 
    PUBLIC((byte) 1, "公共菜单"),
    PRIVATE((byte) 2, "私有菜单")
    ;
 
    byte type;
    String desc;
 
    MenuItemTypeEnum(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;
    }
 
    public static Map<Byte, MenuItemTypeEnum> getMap() {
        return map;
    }
 
    public static void setMap(Map<Byte, MenuItemTypeEnum> map) {
        MenuItemTypeEnum.map = map;
    }
 
    static Map<Byte, MenuItemTypeEnum> map;
    static {
        map = new HashMap<>();
        for (MenuItemTypeEnum e : MenuItemTypeEnum.values()) {
            map.put(e.getType(), e);
        }
    }
 
    public static MenuItemTypeEnum parse(Byte type) {
        return map.get(type);
    }
}