提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 无线设备类型 |
|
7 |
* @date 2022/07/19 10:21:10 |
|
8 |
*/ |
|
9 |
public enum NET_WIRELESSDEV_LOWPOWER_TYPE { |
|
10 |
/** |
|
11 |
未知设备 |
|
12 |
*/ |
|
13 |
NET_WIRELESSDEV_UNKNOWN(0,"未知设备"), |
|
14 |
/** |
|
15 |
无线遥控器 |
|
16 |
*/ |
|
17 |
NET_WIRELESSDEV_CONTROL(1,"无线遥控器"), |
|
18 |
/** |
|
19 |
无线防区 |
|
20 |
*/ |
|
21 |
NET_WIRELESSDEV_DEFENCE(2,"无线防区"), |
|
22 |
/** |
|
23 |
无线键盘 |
|
24 |
*/ |
|
25 |
NET_WIRELESSDEV_KEYBOARD(3,"无线键盘"), |
|
26 |
/** |
|
27 |
无线门磁 此字段协议上已废弃 |
|
28 |
*/ |
|
29 |
NET_WIRELESSDEV_MAGNETOMER(4,"无线门磁 此字段协议上已废弃"), |
|
30 |
/** |
|
31 |
无线警号 |
|
32 |
*/ |
|
33 |
NET_WIRELESSDEV_ALARMBELL(5,"无线警号"), |
|
34 |
/** |
|
35 |
智能锁 |
|
36 |
*/ |
|
37 |
NET_WIRELESSDEV_SMARTLOCK(6,"智能锁"); |
|
38 |
|
|
39 |
private int value; |
|
40 |
|
|
41 |
private String note; |
|
42 |
|
|
43 |
public String getNote() { |
|
44 |
return note; |
|
45 |
} |
|
46 |
|
|
47 |
public int getValue() { |
|
48 |
return value; |
|
49 |
} |
|
50 |
|
|
51 |
NET_WIRELESSDEV_LOWPOWER_TYPE(int givenValue, String note) { |
|
52 |
this.value = givenValue; |
|
53 |
this.note = note; |
|
54 |
} |
|
55 |
|
|
56 |
public static String getNoteByValue(int givenValue) { |
|
57 |
for (NET_WIRELESSDEV_LOWPOWER_TYPE enumType : NET_WIRELESSDEV_LOWPOWER_TYPE.values()) { |
|
58 |
if (givenValue == enumType.getValue()) { |
|
59 |
return enumType.getNote(); |
|
60 |
} |
|
61 |
} |
|
62 |
return null; |
|
63 |
} |
|
64 |
|
|
65 |
public static int getValueByNote(String givenNote) { |
|
66 |
for (NET_WIRELESSDEV_LOWPOWER_TYPE enumType : NET_WIRELESSDEV_LOWPOWER_TYPE.values()) { |
|
67 |
if (givenNote.equals(enumType.getNote())) { |
|
68 |
return enumType.getValue(); |
|
69 |
} |
|
70 |
} |
|
71 |
return -1; |
|
72 |
} |
|
73 |
|
|
74 |
public static NET_WIRELESSDEV_LOWPOWER_TYPE getEnum(int value) { |
|
75 |
for (NET_WIRELESSDEV_LOWPOWER_TYPE e : NET_WIRELESSDEV_LOWPOWER_TYPE.values()) { |
|
76 |
if (e.getValue() == value) |
|
77 |
return e; |
|
78 |
} |
|
79 |
return NET_WIRELESSDEV_LOWPOWER_TYPE.NET_WIRELESSDEV_UNKNOWN; |
|
80 |
} |
|
81 |
|
|
82 |
} |