提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 人员健康状态 |
|
7 |
* @date 2022/03/08 11:25:17 |
|
8 |
*/ |
|
9 |
public enum EM_GREENCNHEALTH_STATUS { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_GREENCNHEALTH_STATUS_UNKNOWN(0,"未知"), |
|
14 |
/** |
|
15 |
绿码 |
|
16 |
*/ |
|
17 |
EM_GREENCNHEALTH_STATUS_GREEN(1,"绿码"), |
|
18 |
/** |
|
19 |
黄码 |
|
20 |
*/ |
|
21 |
EM_GREENCNHEALTH_STATUS_YELLOW(2,"黄码"), |
|
22 |
/** |
|
23 |
红码 |
|
24 |
*/ |
|
25 |
EM_GREENCNHEALTH_STATUS_RED(3,"红码"), |
|
26 |
/** |
|
27 |
无效 |
|
28 |
*/ |
|
29 |
EM_GREENCNHEALTH_STATUS_INVALID(4,"无效"); |
|
30 |
|
|
31 |
private int value; |
|
32 |
|
|
33 |
private String note; |
|
34 |
|
|
35 |
public String getNote() { |
|
36 |
return note; |
|
37 |
} |
|
38 |
|
|
39 |
public int getValue() { |
|
40 |
return value; |
|
41 |
} |
|
42 |
|
|
43 |
EM_GREENCNHEALTH_STATUS(int givenValue, String note) { |
|
44 |
this.value = givenValue; |
|
45 |
this.note = note; |
|
46 |
} |
|
47 |
|
|
48 |
public static String getNoteByValue(int givenValue) { |
|
49 |
for (EM_GREENCNHEALTH_STATUS enumType : EM_GREENCNHEALTH_STATUS.values()) { |
|
50 |
if (givenValue == enumType.getValue()) { |
|
51 |
return enumType.getNote(); |
|
52 |
} |
|
53 |
} |
|
54 |
return null; |
|
55 |
} |
|
56 |
|
|
57 |
public static int getValueByNote(String givenNote) { |
|
58 |
for (EM_GREENCNHEALTH_STATUS enumType : EM_GREENCNHEALTH_STATUS.values()) { |
|
59 |
if (givenNote.equals(enumType.getNote())) { |
|
60 |
return enumType.getValue(); |
|
61 |
} |
|
62 |
} |
|
63 |
return -1; |
|
64 |
} |
|
65 |
|
|
66 |
public static EM_GREENCNHEALTH_STATUS getEnum(int value) { |
|
67 |
for (EM_GREENCNHEALTH_STATUS e : EM_GREENCNHEALTH_STATUS.values()) { |
|
68 |
if (e.getValue() == value) |
|
69 |
return e; |
|
70 |
} |
|
71 |
return EM_GREENCNHEALTH_STATUS.EM_GREENCNHEALTH_STATUS_UNKNOWN; |
|
72 |
} |
|
73 |
|
|
74 |
} |