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
| package com.mindskip.xzs.domain.enums;
|
| import java.util.HashMap;
| import java.util.Map;
|
| public enum QuestionSourceEnum {
|
| SINGLECHOICE(1,2),
| MULTIPLECHOICE(2,2),
| TRUEORFALSE(3,2);
|
|
|
| int type;
| int source;
|
|
| QuestionSourceEnum(int type, int source) {
| this.type = type;
| this.source = source;
| }
|
| private static final Map<Integer, Integer> keyMap = new HashMap<>();
|
| static {
| for (QuestionSourceEnum item : QuestionSourceEnum.values()) {
| keyMap.put(item.getType(), item.getSource());
| }
| }
|
| public static Integer fromType(Integer type) {
| return keyMap.get(type);
| }
|
|
| public int getType() {
| return type;
| }
|
| public void setType(int type) {
| this.type = type;
| }
|
| public int getSource() {
| return source;
| }
|
| public void setSource(int source) {
| this.source = source;
| }
| }
|
|