提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author : 47040 |
|
5 |
* @since : Created in 2020/8/13 9:54 |
|
6 |
*/ |
|
7 |
public enum EM_CUSTOM_DEV_PROTOCOL_TYPE { |
|
8 |
|
|
9 |
/** |
|
10 |
* Private |
|
11 |
*/ |
|
12 |
EM_CUSTOM_DEV_PROTOCOL_TYPE_PRIVATE(0, "Private"), |
|
13 |
/** |
|
14 |
* Dahua2 |
|
15 |
*/ |
|
16 |
EM_CUSTOM_DEV_PROTOCOL_TYPE_DAHUA2(1, "Dahua2"), |
|
17 |
/** |
|
18 |
* Dahua3 |
|
19 |
*/ |
|
20 |
EM_CUSTOM_DEV_PROTOCOL_TYPE_DAHUA3(2, "Dahua3"), |
|
21 |
/** |
|
22 |
* 以URL形式添加的设备 |
|
23 |
*/ |
|
24 |
EM_CUSTOM_DEV_PROTOCOL_TYPE_GENERAL(3, "以URL形式添加的设备"), |
|
25 |
/** |
|
26 |
* Onvif接入 |
|
27 |
*/ |
|
28 |
EM_CUSTOM_DEV_PROTOCOL_TYPE_ONVIF(4, "Onvif接入"), |
|
29 |
/** |
|
30 |
* Onvif加密形式接入 |
|
31 |
*/ |
|
32 |
EM_CUSTOM_DEV_PROTOCOL_TYPE_ONVIFS(5, "Onvif加密形式接入"), |
|
33 |
/** |
|
34 |
* 国标28181接入 |
|
35 |
*/ |
|
36 |
EM_CUSTOM_DEV_PROTOCOL_TYPE_GB28181(6, "国标28181接入"), |
|
37 |
/** |
|
38 |
* Ehome协议 |
|
39 |
*/ |
|
40 |
EM_CUSTOM_DEV_PROTOCOL_TYPE_EHOME(7, "Ehome协议"), |
|
41 |
/** |
|
42 |
* 主动注册 |
|
43 |
*/ |
|
44 |
EM_CUSTOM_DEV_PROTOCOL_TYPE_DAHUA_REG(8, "主动注册"); |
|
45 |
|
|
46 |
private int value; |
|
47 |
private String note; |
|
48 |
|
|
49 |
private EM_CUSTOM_DEV_PROTOCOL_TYPE(int givenValue, String note) { |
|
50 |
this.value = givenValue; |
|
51 |
this.note = note; |
|
52 |
} |
|
53 |
|
|
54 |
public String getNote() { |
|
55 |
return note; |
|
56 |
} |
|
57 |
|
|
58 |
public int getValue() { |
|
59 |
return value; |
|
60 |
} |
|
61 |
|
|
62 |
public static String getNoteByValue(int givenValue) { |
|
63 |
for (EM_CUSTOM_DEV_PROTOCOL_TYPE enumType : EM_CUSTOM_DEV_PROTOCOL_TYPE.values()) { |
|
64 |
if (givenValue == enumType.getValue()) { |
|
65 |
return enumType.getNote(); |
|
66 |
} |
|
67 |
} |
|
68 |
return null; |
|
69 |
} |
|
70 |
|
|
71 |
public static int getValueByNote(String givenNote) { |
|
72 |
for (EM_CUSTOM_DEV_PROTOCOL_TYPE enumType : EM_CUSTOM_DEV_PROTOCOL_TYPE.values()) { |
|
73 |
if (givenNote.equals(enumType.getNote()) ) { |
|
74 |
return enumType.getValue(); |
|
75 |
} |
|
76 |
} |
|
77 |
return -1; |
|
78 |
} |
|
79 |
} |