提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 灯光类型 |
|
6 |
* @date 2023/05/23 09:40:10 |
|
7 |
*/ |
|
8 |
public enum EM_CFG_LC_LIGHT_TYPE { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_CFG_LC_LIGHT_TYPEUNKNOWN(0, "未知"), |
|
13 |
/** |
|
14 |
* 红外灯 |
|
15 |
*/ |
|
16 |
EM_CFG_LC_LIGHT_TYPE_INFRAREDLIGHT(1, "红外灯"), |
|
17 |
/** |
|
18 |
* 白光灯 |
|
19 |
*/ |
|
20 |
EM_CFG_LC_LIGHT_TYPE_WIHTELIGHT(2, "白光灯"), |
|
21 |
/** |
|
22 |
* 激光灯 |
|
23 |
*/ |
|
24 |
EM_CFG_LC_LIGHT_TYPE_LASERLIGHT(3, "激光灯"), |
|
25 |
/** |
|
26 |
* 智能混光灯(根据智能ID切换红外和白光灯) |
|
27 |
*/ |
|
28 |
EM_CFG_LC_LIGHT_TYPE_AIMIXLIGHT(4, "智能混光灯(根据智能ID切换红外和白光灯)"), |
|
29 |
/** |
|
30 |
* 指示灯 |
|
31 |
*/ |
|
32 |
EM_CFG_LC_LIGHT_TYPE_PILOTLIGHT(5, "指示灯"); |
|
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 |
EM_CFG_LC_LIGHT_TYPE(int givenValue, String note) { |
|
47 |
this.value = givenValue; |
|
48 |
this.note = note; |
|
49 |
} |
|
50 |
|
|
51 |
public static String getNoteByValue(int givenValue) { |
|
52 |
for (EM_CFG_LC_LIGHT_TYPE enumType : EM_CFG_LC_LIGHT_TYPE.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 (EM_CFG_LC_LIGHT_TYPE enumType : EM_CFG_LC_LIGHT_TYPE.values()) { |
|
62 |
if (givenNote.equals(enumType.getNote())) { |
|
63 |
return enumType.getValue(); |
|
64 |
} |
|
65 |
} |
|
66 |
return -1; |
|
67 |
} |
|
68 |
} |