提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
public enum EM_EVENT_DETECT_TYPE { |
|
4 |
/**未知*/ |
|
5 |
EM_EVENT_DETECT_TYPE_UNKNOWN(-1,"未知"), |
|
6 |
/**小于等于阈值报警*/ |
|
7 |
EM_EVENT_DETECT_TYPE_LESS_OR_EQUAL(0,"小于等于阈值报警"), |
|
8 |
/**大于等于阈值报警*/ |
|
9 |
EM_EVENT_DETECT_TYPE_GREATER_OR_EQUAL(1,"大于等于阈值报警"), |
|
10 |
/**等于阀值报警*/ |
|
11 |
EM_EVENT_DETECT_TYPE_EQUAL(2,"等于阀值报警"), |
|
12 |
/**不等于阀值报警*/ |
|
13 |
EM_EVENT_DETECT_TYPE_NOEQUAL(3,"不等于阀值报警"), |
|
14 |
/**人数变化报警*/ |
|
15 |
EM_EVENT_DETECT_TYPE_CHANGE(4,"人数变化报警"), |
|
16 |
/**大于阈值报警*/ |
|
17 |
EM_EVENT_DETECT_TYPE_GREATER(5,"大于阈值报警"), |
|
18 |
/**小于阈值报警*/ |
|
19 |
EM_EVENT_DETECT_TYPE_LESS(6,"小于阈值报警"), |
|
20 |
/**区间内报警,检测人数在区间范围内报警,包括边界值。区间值对应PersonNum字段*/ |
|
21 |
EM_EVENT_DETECT_TYPE_IN_INTERVAL(7,"区间内报警,检测人数在区间范围内报警,包括边界值。区间值对应PersonNum字段"), |
|
22 |
/**区间外报警,检测人数在区间范围外报警,不包括边界值。区间值对应PersonNum字段*/ |
|
23 |
EM_EVENT_DETECT_TYPE_OUT_INTERVAL(8,"区间外报警,检测人数在区间范围外报警,不包括边界值。区间值对应PersonNum字段"); |
|
24 |
|
|
25 |
private int value; |
|
26 |
|
|
27 |
private String note; |
|
28 |
|
|
29 |
public String getNote() { |
|
30 |
return note; |
|
31 |
} |
|
32 |
|
|
33 |
public int getValue() { |
|
34 |
return value; |
|
35 |
} |
|
36 |
|
|
37 |
EM_EVENT_DETECT_TYPE(int givenValue, String note) { |
|
38 |
this.value = givenValue; |
|
39 |
this.note = note; |
|
40 |
} |
|
41 |
|
|
42 |
public static String getNoteByValue(int givenValue) { |
|
43 |
for (EM_EVENT_DETECT_TYPE enumType : EM_EVENT_DETECT_TYPE.values()) { |
|
44 |
if (givenValue == enumType.getValue()) { |
|
45 |
return enumType.getNote(); |
|
46 |
} |
|
47 |
} |
|
48 |
return null; |
|
49 |
} |
|
50 |
|
|
51 |
public static int getValueByNote(String givenNote) { |
|
52 |
for (EM_EVENT_DETECT_TYPE enumType : EM_EVENT_DETECT_TYPE.values()) { |
|
53 |
if (givenNote.equals(enumType.getNote())) { |
|
54 |
return enumType.getValue(); |
|
55 |
} |
|
56 |
} |
|
57 |
return -2; |
|
58 |
} |
|
59 |
|
|
60 |
public static EM_EVENT_DETECT_TYPE getEnum(int value) { |
|
61 |
for (EM_EVENT_DETECT_TYPE e : EM_EVENT_DETECT_TYPE.values()) { |
|
62 |
if (e.getValue() == value) |
|
63 |
return e; |
|
64 |
} |
|
65 |
return EM_EVENT_DETECT_TYPE.EM_EVENT_DETECT_TYPE_UNKNOWN; |
|
66 |
} |
|
67 |
|
|
68 |
} |