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
package com.ycl.jxkg.enums;
 
import java.util.HashMap;
import java.util.Map;
 
public enum DeductTypeEnum {
 
    AllCorrect(1, "答错不得分"),
    PartCorrect(2, "漏选得固定分值,包含错误选项不得分"),
    EachCorrect(3, "每对一题得相应分值,包含错误选项不得分");
 
    int code;
    String name;
 
    DeductTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }
 
 
    private static Map<Integer, DeductTypeEnum> keyMap = new HashMap<>();
 
    static {
        for (DeductTypeEnum item : DeductTypeEnum.values()) {
            keyMap.put(item.getCode(), item);
        }
    }
 
    public static DeductTypeEnum 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;
    }
 
}