提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 布撤防状态 |
|
6 |
* @date 2021/11/08 |
|
7 |
*/ |
|
8 |
public enum EM_ARM_STATE { |
|
9 |
|
|
10 |
// 未知 |
|
11 |
EM_ARM_STATE_UNKNOWN(0, "未知"), |
|
12 |
|
|
13 |
// Total布防 |
|
14 |
EM_ARM_STATE_TOTAL_ARMING(1, "Total布防"), |
|
15 |
|
|
16 |
// partial1布防 |
|
17 |
EM_ARM_STATE_PARTIAL1_ARMING(2, "partial1布防"), |
|
18 |
|
|
19 |
// partial2布防 |
|
20 |
EM_ARM_STATE_PARTIAL2_ARMING(3, "partial2布防"), |
|
21 |
|
|
22 |
// partial1+2布防 |
|
23 |
EM_ARM_STATE_PARTIAL1_PARTIAL2_ARMING(4, "partial1+2布防"), |
|
24 |
|
|
25 |
// 强制布防 |
|
26 |
EM_ARM_STATE_FORCEARMING(5, "强制布防"), |
|
27 |
|
|
28 |
// 撤防 |
|
29 |
EM_ARM_STATE_DISARMING(6, "撤防"); |
|
30 |
|
|
31 |
private int value; |
|
32 |
private String note; |
|
33 |
|
|
34 |
private EM_ARM_STATE(int givenValue, String note) { |
|
35 |
this.value = givenValue; |
|
36 |
this.note = note; |
|
37 |
} |
|
38 |
|
|
39 |
public String getNote() { |
|
40 |
return note; |
|
41 |
} |
|
42 |
|
|
43 |
public int getValue() { |
|
44 |
return value; |
|
45 |
} |
|
46 |
|
|
47 |
public static String getNoteByValue(int givenValue) { |
|
48 |
for (EM_ARM_STATE enumType : EM_ARM_STATE.values()) { |
|
49 |
if (givenValue == enumType.getValue()) { |
|
50 |
return enumType.getNote(); |
|
51 |
} |
|
52 |
} |
|
53 |
return null; |
|
54 |
} |
|
55 |
|
|
56 |
public static int getValueByNote(String givenNote) { |
|
57 |
for (EM_ARM_STATE enumType : EM_ARM_STATE.values()) { |
|
58 |
if (givenNote.equals(enumType.getNote())) { |
|
59 |
return enumType.getValue(); |
|
60 |
} |
|
61 |
} |
|
62 |
return -1; |
|
63 |
} |
|
64 |
} |