提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.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_ALLOW_PERMIT_FLAG { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_ALLOW_PERMIT_FLAG_UNKNOWN(0,"未知"), |
|
14 |
/** |
|
15 |
没有电子通行证 |
|
16 |
*/ |
|
17 |
EM_ALLOW_PERMIT_FLAG_NO(1,"没有电子通行证"), |
|
18 |
/** |
|
19 |
电子通行证有效 |
|
20 |
*/ |
|
21 |
EM_ALLOW_PERMIT_FLAG_EFFECTIVE(2,"电子通行证有效"), |
|
22 |
/** |
|
23 |
电子通行证无效 |
|
24 |
*/ |
|
25 |
EM_ALLOW_PERMIT_FLAG_INVALID(3,"电子通行证无效"); |
|
26 |
|
|
27 |
private int value; |
|
28 |
|
|
29 |
private String note; |
|
30 |
|
|
31 |
public String getNote() { |
|
32 |
return note; |
|
33 |
} |
|
34 |
|
|
35 |
public int getValue() { |
|
36 |
return value; |
|
37 |
} |
|
38 |
|
|
39 |
EM_ALLOW_PERMIT_FLAG(int givenValue, String note) { |
|
40 |
this.value = givenValue; |
|
41 |
this.note = note; |
|
42 |
} |
|
43 |
|
|
44 |
public static String getNoteByValue(int givenValue) { |
|
45 |
for (EM_ALLOW_PERMIT_FLAG enumType : EM_ALLOW_PERMIT_FLAG.values()) { |
|
46 |
if (givenValue == enumType.getValue()) { |
|
47 |
return enumType.getNote(); |
|
48 |
} |
|
49 |
} |
|
50 |
return null; |
|
51 |
} |
|
52 |
|
|
53 |
public static int getValueByNote(String givenNote) { |
|
54 |
for (EM_ALLOW_PERMIT_FLAG enumType : EM_ALLOW_PERMIT_FLAG.values()) { |
|
55 |
if (givenNote.equals(enumType.getNote())) { |
|
56 |
return enumType.getValue(); |
|
57 |
} |
|
58 |
} |
|
59 |
return -1; |
|
60 |
} |
|
61 |
|
|
62 |
public static EM_ALLOW_PERMIT_FLAG getEnum(int value) { |
|
63 |
for (EM_ALLOW_PERMIT_FLAG e : EM_ALLOW_PERMIT_FLAG.values()) { |
|
64 |
if (e.getValue() == value) |
|
65 |
return e; |
|
66 |
} |
|
67 |
return EM_ALLOW_PERMIT_FLAG.EM_ALLOW_PERMIT_FLAG_UNKNOWN; |
|
68 |
} |
|
69 |
|
|
70 |
} |