提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 报警类型 |
|
7 |
* @date 2022/08/31 14:44:15 |
|
8 |
*/ |
|
9 |
public enum EM_ACCESSORY_ALARM_TYPE { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_ACCESSORY_ALARM_UNKNOWN(-1,"未知"), |
|
14 |
/** |
|
15 |
入侵 |
|
16 |
*/ |
|
17 |
EM_ACCESSORY_ALARM_INTRUSION(0,"入侵"), |
|
18 |
/** |
|
19 |
火警 |
|
20 |
*/ |
|
21 |
EM_ACCESSORY_ALARM_FIRE(1,"火警"), |
|
22 |
/** |
|
23 |
医疗 |
|
24 |
*/ |
|
25 |
EM_ACCESSORY_ALARM_MEDICAL(2,"医疗"), |
|
26 |
/** |
|
27 |
紧急 |
|
28 |
*/ |
|
29 |
EM_ACCESSORY_ALARM_PANIC(3,"紧急"), |
|
30 |
/** |
|
31 |
燃气 |
|
32 |
*/ |
|
33 |
EM_ACCESSORY_ALARM_GAS(4,"燃气"), |
|
34 |
/** |
|
35 |
双按钮紧急按钮报警类型 |
|
36 |
*/ |
|
37 |
EM_ACCESSORY_ALARM_HOLDUP(5,"双按钮紧急按钮报警类型"); |
|
38 |
|
|
39 |
private int value; |
|
40 |
|
|
41 |
private String note; |
|
42 |
|
|
43 |
public String getNote() { |
|
44 |
return note; |
|
45 |
} |
|
46 |
|
|
47 |
public int getValue() { |
|
48 |
return value; |
|
49 |
} |
|
50 |
|
|
51 |
EM_ACCESSORY_ALARM_TYPE(int givenValue, String note) { |
|
52 |
this.value = givenValue; |
|
53 |
this.note = note; |
|
54 |
} |
|
55 |
|
|
56 |
public static String getNoteByValue(int givenValue) { |
|
57 |
for (EM_ACCESSORY_ALARM_TYPE enumType : EM_ACCESSORY_ALARM_TYPE.values()) { |
|
58 |
if (givenValue == enumType.getValue()) { |
|
59 |
return enumType.getNote(); |
|
60 |
} |
|
61 |
} |
|
62 |
return null; |
|
63 |
} |
|
64 |
|
|
65 |
public static int getValueByNote(String givenNote) { |
|
66 |
for (EM_ACCESSORY_ALARM_TYPE enumType : EM_ACCESSORY_ALARM_TYPE.values()) { |
|
67 |
if (givenNote.equals(enumType.getNote())) { |
|
68 |
return enumType.getValue(); |
|
69 |
} |
|
70 |
} |
|
71 |
return -2; |
|
72 |
} |
|
73 |
|
|
74 |
public static EM_ACCESSORY_ALARM_TYPE getEnum(int value) { |
|
75 |
for (EM_ACCESSORY_ALARM_TYPE e : EM_ACCESSORY_ALARM_TYPE.values()) { |
|
76 |
if (e.getValue() == value) |
|
77 |
return e; |
|
78 |
} |
|
79 |
return EM_ACCESSORY_ALARM_TYPE.EM_ACCESSORY_ALARM_UNKNOWN; |
|
80 |
} |
|
81 |
|
|
82 |
} |