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
| package com.gk.hotwork.specialWork.enums;
|
| import java.util.HashMap;
| import java.util.Map;
|
| public enum WorkProcessWarningTypeEnum {
| CHECK((byte)1,"检查"),
| DETECTION((byte)2,"检测"),
| ;
|
| public byte code;
| public String value;
|
| WorkProcessWarningTypeEnum(Byte code, String value) {
| this.code = code;
| this.value = value;
| }
|
|
|
| static Map<Byte, WorkProcessWarningTypeEnum> map;
| static {
| map = new HashMap<>();
| for (WorkProcessWarningTypeEnum e : WorkProcessWarningTypeEnum.values()) {
| map.put(e.code, e);
| }
| }
| public static WorkProcessWarningTypeEnum parse(Byte code) {
| return map.get(code);
| }
| }
|
|