提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 防区类型 |
|
7 |
* @date 2022/07/19 19:31:27 |
|
8 |
*/ |
|
9 |
public enum EM_DEFENCE_AREA_TYPE { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_DEFENCE_AREA_TYPE_UNKNOWN(0,"未知"), |
|
14 |
/** |
|
15 |
立即防区 |
|
16 |
*/ |
|
17 |
EM_DEFENCE_AREA_TYPE_INTIME(1,"立即防区"), |
|
18 |
/** |
|
19 |
延时防区 |
|
20 |
*/ |
|
21 |
EM_DEFENCE_AREA_TYPE_DELAY(2,"延时防区"), |
|
22 |
/** |
|
23 |
延时防区2 |
|
24 |
*/ |
|
25 |
EM_DEFENCE_AREA_TYPE_DELAY2(3,"延时防区2"), |
|
26 |
/** |
|
27 |
跟随防区 |
|
28 |
*/ |
|
29 |
EM_DEFENCE_AREA_TYPE_FOLLOW(4,"跟随防区"), |
|
30 |
/** |
|
31 |
退出防区 |
|
32 |
*/ |
|
33 |
EM_DEFENCE_AREA_TYPE_EXITEND(5,"退出防区"), |
|
34 |
/** |
|
35 |
24小时防区 |
|
36 |
*/ |
|
37 |
EM_DEFENCE_AREA_TYPE_FULLDAY(6,"24小时防区"), |
|
38 |
/** |
|
39 |
火警防区 |
|
40 |
*/ |
|
41 |
EM_DEFENCE_AREA_TYPE_FIRE(7,"火警防区"), |
|
42 |
/** |
|
43 |
恐慌防区 |
|
44 |
*/ |
|
45 |
EM_DEFENCE_AREA_TYPE_PANIC(8,"恐慌防区"), |
|
46 |
/** |
|
47 |
匪警防区 |
|
48 |
*/ |
|
49 |
EM_DEFENCE_AREA_TYPE_ROBBERY(9,"匪警防区"), |
|
50 |
/** |
|
51 |
医疗紧急防区 |
|
52 |
*/ |
|
53 |
EM_DEFENCE_AREA_TYPE_MEDICAL(10,"医疗紧急防区"), |
|
54 |
/** |
|
55 |
key防区 |
|
56 |
*/ |
|
57 |
EM_DEFENCE_AREA_TYPE_KEY(11,"key防区"); |
|
58 |
|
|
59 |
private int value; |
|
60 |
|
|
61 |
private String note; |
|
62 |
|
|
63 |
public String getNote() { |
|
64 |
return note; |
|
65 |
} |
|
66 |
|
|
67 |
public int getValue() { |
|
68 |
return value; |
|
69 |
} |
|
70 |
|
|
71 |
EM_DEFENCE_AREA_TYPE(int givenValue, String note) { |
|
72 |
this.value = givenValue; |
|
73 |
this.note = note; |
|
74 |
} |
|
75 |
|
|
76 |
public static String getNoteByValue(int givenValue) { |
|
77 |
for (EM_DEFENCE_AREA_TYPE enumType : EM_DEFENCE_AREA_TYPE.values()) { |
|
78 |
if (givenValue == enumType.getValue()) { |
|
79 |
return enumType.getNote(); |
|
80 |
} |
|
81 |
} |
|
82 |
return null; |
|
83 |
} |
|
84 |
|
|
85 |
public static int getValueByNote(String givenNote) { |
|
86 |
for (EM_DEFENCE_AREA_TYPE enumType : EM_DEFENCE_AREA_TYPE.values()) { |
|
87 |
if (givenNote.equals(enumType.getNote())) { |
|
88 |
return enumType.getValue(); |
|
89 |
} |
|
90 |
} |
|
91 |
return -1; |
|
92 |
} |
|
93 |
|
|
94 |
public static EM_DEFENCE_AREA_TYPE getEnum(int value) { |
|
95 |
for (EM_DEFENCE_AREA_TYPE e : EM_DEFENCE_AREA_TYPE.values()) { |
|
96 |
if (e.getValue() == value) |
|
97 |
return e; |
|
98 |
} |
|
99 |
return EM_DEFENCE_AREA_TYPE.EM_DEFENCE_AREA_TYPE_UNKNOWN; |
|
100 |
} |
|
101 |
|
|
102 |
} |