提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 291189 |
|
5 |
* @description 布撤防类型 |
|
6 |
* @date 2022/07/19 10:54:34 |
|
7 |
*/ |
|
8 |
public enum EM_ARM_TYPE { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_ARM_TYPE_UNKNOWN(0, "未知"), |
|
13 |
/** |
|
14 |
* Total布防 |
|
15 |
*/ |
|
16 |
EM_ARM_TYPE_TOTAL_ARMING(1, "Total布防"), |
|
17 |
/** |
|
18 |
* partial1布防 |
|
19 |
*/ |
|
20 |
EM_ARM_TYPE_PARTIAL1_ARMING(2, "partial1布防"), |
|
21 |
/** |
|
22 |
* partial2布防 |
|
23 |
*/ |
|
24 |
EM_ARM_TYPE_PARTIAL2_ARMING(3, "partial2布防"), |
|
25 |
/** |
|
26 |
* partial1+2布防 |
|
27 |
*/ |
|
28 |
EM_ARM_TYPE_PARTIAL_ARMING(4, "partial1+2布防"), |
|
29 |
/** |
|
30 |
* 强制布防 |
|
31 |
*/ |
|
32 |
EM_ARM_TYPE_DENFENCE_ARMING(5, "强制布防"), |
|
33 |
/** |
|
34 |
* 撤防 |
|
35 |
*/ |
|
36 |
EM_ARM_TYPE_DISARMING(6, "撤防"); |
|
37 |
|
|
38 |
private int value; |
|
39 |
|
|
40 |
private String note; |
|
41 |
|
|
42 |
public String getNote() { |
|
43 |
return note; |
|
44 |
} |
|
45 |
|
|
46 |
public int getValue() { |
|
47 |
return value; |
|
48 |
} |
|
49 |
|
|
50 |
EM_ARM_TYPE(int givenValue, String note) { |
|
51 |
this.value = givenValue; |
|
52 |
this.note = note; |
|
53 |
} |
|
54 |
|
|
55 |
public static String getNoteByValue(int givenValue) { |
|
56 |
for (EM_ARM_TYPE enumType : EM_ARM_TYPE.values()) { |
|
57 |
if (givenValue == enumType.getValue()) { |
|
58 |
return enumType.getNote(); |
|
59 |
} |
|
60 |
} |
|
61 |
return null; |
|
62 |
} |
|
63 |
|
|
64 |
public static int getValueByNote(String givenNote) { |
|
65 |
for (EM_ARM_TYPE enumType : EM_ARM_TYPE.values()) { |
|
66 |
if (givenNote.equals(enumType.getNote())) { |
|
67 |
return enumType.getValue(); |
|
68 |
} |
|
69 |
} |
|
70 |
return -1; |
|
71 |
} |
|
72 |
|
|
73 |
public static EM_ARM_TYPE getEnum(int value) { |
|
74 |
for (EM_ARM_TYPE e : EM_ARM_TYPE.values()) { |
|
75 |
if (e.getValue() == value) |
|
76 |
return e; |
|
77 |
} |
|
78 |
return EM_ARM_TYPE.EM_ARM_TYPE_UNKNOWN; |
|
79 |
} |
|
80 |
|
|
81 |
} |