提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author : 260611 |
|
6 |
* @description : 报警类型 |
|
7 |
* @since : Created in 2021/11/26 10:13 |
|
8 |
*/ |
|
9 |
|
|
10 |
public enum EM_CFG_CROSSREGION_ALARMTYPE { |
|
11 |
/** |
|
12 |
* 未知 |
|
13 |
*/ |
|
14 |
EM_CFG_CROSSREGION_ALARMTYPE_UNKNOWN(0,"未知"), |
|
15 |
/** |
|
16 |
* 报警 |
|
17 |
*/ |
|
18 |
EM_CFG_CROSSREGION_ALARMTYPE_ALARM(1,"报警"), |
|
19 |
/** |
|
20 |
* 预警 |
|
21 |
*/ |
|
22 |
EM_CFG_CROSSREGION_ALARMTYPE_WARNING(2,"预警"), |
|
23 |
/** |
|
24 |
* 屏蔽 |
|
25 |
*/ |
|
26 |
EM_CFG_CROSSREGION_ALARMTYPE_SHIELD(3,"屏蔽"); |
|
27 |
|
|
28 |
private int value; |
|
29 |
|
|
30 |
private String note; |
|
31 |
|
|
32 |
public String getNote() { |
|
33 |
return note; |
|
34 |
} |
|
35 |
|
|
36 |
public int getValue() { |
|
37 |
return value; |
|
38 |
} |
|
39 |
|
|
40 |
EM_CFG_CROSSREGION_ALARMTYPE(int givenValue, String note) { |
|
41 |
this.value = givenValue; |
|
42 |
this.note = note; |
|
43 |
} |
|
44 |
|
|
45 |
public static String getNoteByValue(int givenValue) { |
|
46 |
for (EM_CFG_CROSSREGION_ALARMTYPE enumType : EM_CFG_CROSSREGION_ALARMTYPE.values()) { |
|
47 |
if (givenValue == enumType.getValue()) { |
|
48 |
return enumType.getNote(); |
|
49 |
} |
|
50 |
} |
|
51 |
return null; |
|
52 |
} |
|
53 |
|
|
54 |
public static int getValueByNote(String givenNote) { |
|
55 |
for (EM_CFG_CROSSREGION_ALARMTYPE enumType : EM_CFG_CROSSREGION_ALARMTYPE.values()) { |
|
56 |
if (givenNote.equals(enumType.getNote())) { |
|
57 |
return enumType.getValue(); |
|
58 |
} |
|
59 |
} |
|
60 |
return -1; |
|
61 |
} |
|
62 |
|
|
63 |
public static EM_CFG_CROSSREGION_ALARMTYPE getEnum(int value) { |
|
64 |
for (EM_CFG_CROSSREGION_ALARMTYPE e : EM_CFG_CROSSREGION_ALARMTYPE.values()) { |
|
65 |
if (e.getValue() == value) |
|
66 |
return e; |
|
67 |
} |
|
68 |
return EM_CFG_CROSSREGION_ALARMTYPE.EM_CFG_CROSSREGION_ALARMTYPE_UNKNOWN; |
|
69 |
} |
|
70 |
|
|
71 |
} |