xiangpei
2025-05-14 47cd9ecc0eff38ffe6b3b794b2bf197e958f4403
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
package com.mindskip.xzs.domain.enums;
 
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
 
public enum ExamPaperTypeEnum {
 
    Fixed(1, "固定试卷"),
    TimeLimit(4, "时段试卷"),
    Task(6, "任务试卷"),
    Random(7,"随机试卷");
 
    int code;
    String name;
 
    ExamPaperTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }
 
 
    private static final Map<Integer, ExamPaperTypeEnum> keyMap = new HashMap<>();
 
    static {
        for (ExamPaperTypeEnum item : ExamPaperTypeEnum.values()) {
            keyMap.put(item.getCode(), item);
        }
    }
 
    public static ExamPaperTypeEnum fromCode(Integer code) {
        return keyMap.get(code);
    }
 
 
    public int getCode() {
        return code;
    }
 
    public void setCode(int code) {
        this.code = code;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
 
}