提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description Low Rate Wireless Personal Area Network 低速无线私域网 begin 无线设备类型 |
|
6 |
* @date 2023/03/16 14:52:52 |
|
7 |
*/ |
|
8 |
public enum NET_WIRELESS_DEVICE_TYPE { |
|
9 |
/** |
|
10 |
|
|
11 |
*/ |
|
12 |
NET_WIRELESS_DEVICE_TYPE_UNKNOWN(0, ""), |
|
13 |
/** |
|
14 |
* 无线键盘 |
|
15 |
*/ |
|
16 |
NET_WIRELESS_DEVICE_TYPE_KEYBOARD(1, "无线键盘"), |
|
17 |
/** |
|
18 |
* 无线防区 |
|
19 |
*/ |
|
20 |
NET_WIRELESS_DEVICE_TYPE_DEFENCE(2, "无线防区"), |
|
21 |
/** |
|
22 |
* 无线遥控 |
|
23 |
*/ |
|
24 |
NET_WIRELESS_DEVICE_TYPE_REMOTECONTROL(3, "无线遥控"), |
|
25 |
/** |
|
26 |
* 无线门磁 |
|
27 |
*/ |
|
28 |
NET_WIRELESS_DEVICE_TYPE_MAGNETOMER(4, "无线门磁"), |
|
29 |
/** |
|
30 |
* 无线警号 |
|
31 |
*/ |
|
32 |
NET_WIRELESS_DEVICE_TYPE_ALARMBELL(5, "无线警号"), |
|
33 |
/** |
|
34 |
* 无线插座 |
|
35 |
*/ |
|
36 |
NET_WIRELESS_DEVICE_TYPE_SWITCHER(6, "无线插座"), |
|
37 |
/** |
|
38 |
* 无线智能锁 |
|
39 |
*/ |
|
40 |
NET_WIRELESS_DEVICE_TYPE_SMARTLOCK(7, "无线智能锁"), |
|
41 |
/** |
|
42 |
* 无线中继器 |
|
43 |
*/ |
|
44 |
NET_WIRELESS_DEVICE_TYPE_REPEATER(8, "无线中继器"); |
|
45 |
|
|
46 |
private int value; |
|
47 |
|
|
48 |
private String note; |
|
49 |
|
|
50 |
public String getNote() { |
|
51 |
return note; |
|
52 |
} |
|
53 |
|
|
54 |
public int getValue() { |
|
55 |
return value; |
|
56 |
} |
|
57 |
|
|
58 |
NET_WIRELESS_DEVICE_TYPE(int givenValue, String note) { |
|
59 |
this.value = givenValue; |
|
60 |
this.note = note; |
|
61 |
} |
|
62 |
|
|
63 |
public static String getNoteByValue(int givenValue) { |
|
64 |
for (NET_WIRELESS_DEVICE_TYPE enumType : NET_WIRELESS_DEVICE_TYPE.values()) { |
|
65 |
if (givenValue == enumType.getValue()) { |
|
66 |
return enumType.getNote(); |
|
67 |
} |
|
68 |
} |
|
69 |
return null; |
|
70 |
} |
|
71 |
|
|
72 |
public static int getValueByNote(String givenNote) { |
|
73 |
for (NET_WIRELESS_DEVICE_TYPE enumType : NET_WIRELESS_DEVICE_TYPE.values()) { |
|
74 |
if (givenNote.equals(enumType.getNote())) { |
|
75 |
return enumType.getValue(); |
|
76 |
} |
|
77 |
} |
|
78 |
return -1; |
|
79 |
} |
|
80 |
} |