fuliqi
2024-10-17 8546b3d285af4235a0ef615a0c6e89486ae2c806
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
package com.ycl.jxkg.enums;
 
import java.util.HashMap;
import java.util.Map;
 
public enum VisibilityEnum {
    Private("1","Private", "只有老师自己能看"),
    Public("2","Public", "所有人能看");
    String code;
    String name;
    String description;
 
    VisibilityEnum(String code,String name, String description) {
        this.code = code;
        this.name = name;
        this.description = description;
    }
 
    public String getDescription() {
        return description;
    }
 
    public void setDescription(String description) {
        this.description = description;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    private static final Map<String, VisibilityEnum> keyMap = new HashMap<>();
 
    static {
        for (VisibilityEnum item : VisibilityEnum.values()) {
            keyMap.put(item.getCode(), item);
        }
    }
    public static VisibilityEnum fromCode(String code) {
        return keyMap.get(code);
    }
 
}