提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 详细类型 |
|
6 |
* @date 2022/12/06 19:32:31 |
|
7 |
*/ |
|
8 |
public enum EM_ENCLOSURE_ALARM_TYPE_EX { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
ENCLOSURE_ALARM_EX_UNKNOWN(0, "未知"), |
|
13 |
/** |
|
14 |
* 驶入 |
|
15 |
*/ |
|
16 |
ENCLOSURE_ALARM_EX_DRIVEIN(1, "驶入"), |
|
17 |
/** |
|
18 |
* 驶出 |
|
19 |
*/ |
|
20 |
ENCLOSURE_ALARM_EX_DRIVEOUT(2, "驶出"), |
|
21 |
/** |
|
22 |
* 超速 |
|
23 |
*/ |
|
24 |
ENCLOSURE_ALARM_EX_OVERSPEED(3, "超速"), |
|
25 |
/** |
|
26 |
* 超速消失 |
|
27 |
*/ |
|
28 |
ENCLOSURE_ALARM_EX_SPEEDCLEAR(4, "超速消失"); |
|
29 |
|
|
30 |
private int value; |
|
31 |
|
|
32 |
private String note; |
|
33 |
|
|
34 |
public String getNote() { |
|
35 |
return note; |
|
36 |
} |
|
37 |
|
|
38 |
public int getValue() { |
|
39 |
return value; |
|
40 |
} |
|
41 |
|
|
42 |
EM_ENCLOSURE_ALARM_TYPE_EX(int givenValue, String note) { |
|
43 |
this.value = givenValue; |
|
44 |
this.note = note; |
|
45 |
} |
|
46 |
|
|
47 |
public static String getNoteByValue(int givenValue) { |
|
48 |
for (EM_ENCLOSURE_ALARM_TYPE_EX enumType : EM_ENCLOSURE_ALARM_TYPE_EX.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_ENCLOSURE_ALARM_TYPE_EX enumType : EM_ENCLOSURE_ALARM_TYPE_EX.values()) { |
|
58 |
if (givenNote.equals(enumType.getNote())) { |
|
59 |
return enumType.getValue(); |
|
60 |
} |
|
61 |
} |
|
62 |
return -1; |
|
63 |
} |
|
64 |
} |