提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
import com.netsdk.lib.structure.*; |
|
4 |
|
|
5 |
/** |
|
6 |
* @author 251823 |
|
7 |
* @description 设置的操作类型 |
|
8 |
* @date 2023/03/15 15:58:57 |
|
9 |
*/ |
|
10 |
public enum NET_EM_SET_ALARMREGION_INFO { |
|
11 |
/** |
|
12 |
* 未知 |
|
13 |
*/ |
|
14 |
NET_EM_SET_ALARMREGION_INFO_UNKNOWN(0, "未知"), |
|
15 |
/** |
|
16 |
* 设置布防模式, 此时CLIENT_SetAlarmRegionInfo接口中的pstuInParam类型为{@link NET_IN_SET_ALARMMODE}, |
|
17 |
* pstuOutParam类型为{@link NET_OUT_SET_ALARMMODE} |
|
18 |
*/ |
|
19 |
NET_EM_SET_ALARMREGION_INFO_ARMMODE(1, |
|
20 |
"设置布防模式, 此时CLIENT_SetAlarmRegionInfo接口中的pstuInParam类型为NET_IN_SET_ALARMMODE, pstuOutParam类型为NET_OUT_SET_ALARMMODE"), |
|
21 |
/** |
|
22 |
* 设置旁路模式, 此时CLIENT_SetAlarmRegionInfo接口中的pstuInParam类型为{@link NET_IN_SET_BYPASSMODE}, |
|
23 |
* pstuOutParam类型为{@link NET_OUT_SET_BYPASSMODE} |
|
24 |
*/ |
|
25 |
NET_EM_SET_ALARMREGION_INFO_BYPASSMODE(2, |
|
26 |
"设置旁路模式, 此时CLIENT_SetAlarmRegionInfo接口中的pstuInParam类型为NET_IN_SET_BYPASSMODE, pstuOutParam类型为NET_OUT_SET_BYPASSMODE"), |
|
27 |
/** |
|
28 |
* 设置输出状态, 此时CLIENT_SetAlarmRegionInfo接口中的pstuInParam类型为{@link NET_IN_SET_OUTPUT_STATE}, |
|
29 |
* pstuOutParam类型为{@link NET_OUT_SET_OUTPUT_STATE} |
|
30 |
*/ |
|
31 |
NET_EM_SET_ALARMREGION_INFO_OUTPUTSTATE(3, |
|
32 |
"设置输出状态, 此时CLIENT_SetAlarmRegionInfo接口中的pstuInParam类型为NET_IN_SET_OUTPUT_STATE, pstuOutParam类型为NET_OUT_SET_OUTPUT_STATE"); |
|
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 |
NET_EM_SET_ALARMREGION_INFO(int givenValue, String note) { |
|
47 |
this.value = givenValue; |
|
48 |
this.note = note; |
|
49 |
} |
|
50 |
|
|
51 |
public static String getNoteByValue(int givenValue) { |
|
52 |
for (NET_EM_SET_ALARMREGION_INFO enumType : NET_EM_SET_ALARMREGION_INFO.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 (NET_EM_SET_ALARMREGION_INFO enumType : NET_EM_SET_ALARMREGION_INFO.values()) { |
|
62 |
if (givenNote.equals(enumType.getNote())) { |
|
63 |
return enumType.getValue(); |
|
64 |
} |
|
65 |
} |
|
66 |
return -1; |
|
67 |
} |
|
68 |
|
|
69 |
public static NET_EM_SET_ALARMREGION_INFO getEnum(int value) { |
|
70 |
for (NET_EM_SET_ALARMREGION_INFO e : NET_EM_SET_ALARMREGION_INFO.values()) { |
|
71 |
if (e.getValue() == value) |
|
72 |
return e; |
|
73 |
} |
|
74 |
return NET_EM_SET_ALARMREGION_INFO.NET_EM_SET_ALARMREGION_INFO_UNKNOWN; |
|
75 |
} |
|
76 |
} |