提交 | 用户 | 时间
|
ce910c
|
1 |
package com.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_TYPE_EX { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_ENCLOSURE_TYPE_EX_UNKNOWN(0, "未知"), |
|
13 |
/** |
|
14 |
* 限速区 |
|
15 |
*/ |
|
16 |
EM_ENCLOSURE_TYPE_EX_LIMITSPEED(1, "限速区"), |
|
17 |
/** |
|
18 |
* 驾驶区 |
|
19 |
*/ |
|
20 |
EM_ENCLOSURE_TYPE_EX_DRIVEALLOW(2, "驾驶区"), |
|
21 |
/** |
|
22 |
* 禁止区 |
|
23 |
*/ |
|
24 |
EM_ENCLOSURE_TYPE_EX_FORBIDDRIVE(3, "禁止区"), |
|
25 |
/** |
|
26 |
* 装货区 |
|
27 |
*/ |
|
28 |
EM_ENCLOSURE_TYPE_EX_LOADGOODS(4, "装货区"), |
|
29 |
/** |
|
30 |
* 卸货区 |
|
31 |
*/ |
|
32 |
EM_ENCLOSURE_TYPE_EX_UPLOADGOODS(5, "卸货区"); |
|
33 |
|
|
34 |
private int value; |
|
35 |
|
|
36 |
private String note; |
|
37 |
|
|
38 |
public String getNote() { |
|
39 |
return note; |
|
40 |
} |
|
41 |
|
|
42 |
public int getValue() { |
|
43 |
return value; |
|
44 |
} |
|
45 |
|
|
46 |
EM_ENCLOSURE_TYPE_EX(int givenValue, String note) { |
|
47 |
this.value = givenValue; |
|
48 |
this.note = note; |
|
49 |
} |
|
50 |
|
|
51 |
public static String getNoteByValue(int givenValue) { |
|
52 |
for (EM_ENCLOSURE_TYPE_EX enumType : EM_ENCLOSURE_TYPE_EX.values()) { |
|
53 |
if (givenValue == enumType.getValue()) { |
|
54 |
return enumType.getNote(); |
|
55 |
} |
|
56 |
} |
|
57 |
return null; |
|
58 |
} |
|
59 |
|
|
60 |
public static int getValueByNote(String givenNote) { |
|
61 |
for (EM_ENCLOSURE_TYPE_EX enumType : EM_ENCLOSURE_TYPE_EX.values()) { |
|
62 |
if (givenNote.equals(enumType.getNote())) { |
|
63 |
return enumType.getValue(); |
|
64 |
} |
|
65 |
} |
|
66 |
return -1; |
|
67 |
} |
|
68 |
} |