提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 大气光模式枚举 |
|
7 |
* @origin autoTool |
|
8 |
* @date 2023/11/30 15:50:59 |
|
9 |
*/ |
|
10 |
public enum CFG_LIGHT_INTENSITY_MODE { |
|
11 |
/** |
|
12 |
* 未知方式 |
|
13 |
*/ |
|
14 |
EM_LIGHT_INTENSITY_MODE_UNKNOW(0,"未知方式"), |
|
15 |
/** |
|
16 |
* 自动 |
|
17 |
*/ |
|
18 |
EM_LIGHT_INTENSITY_MODE_AUTO(1,"自动"), |
|
19 |
/** |
|
20 |
* 手动 |
|
21 |
*/ |
|
22 |
EM_LIGHT_INTENSITY_MODE_MANUL(2,"手动"); |
|
23 |
|
|
24 |
private int value; |
|
25 |
|
|
26 |
private String note; |
|
27 |
|
|
28 |
public String getNote() { |
|
29 |
return note; |
|
30 |
} |
|
31 |
|
|
32 |
public int getValue() { |
|
33 |
return value; |
|
34 |
} |
|
35 |
|
|
36 |
CFG_LIGHT_INTENSITY_MODE(int givenValue, String note) { |
|
37 |
this.value = givenValue; |
|
38 |
this.note = note; |
|
39 |
} |
|
40 |
|
|
41 |
public static String getNoteByValue(int givenValue) { |
|
42 |
for (CFG_LIGHT_INTENSITY_MODE enumType : CFG_LIGHT_INTENSITY_MODE.values()) { |
|
43 |
if (givenValue == enumType.getValue()) { |
|
44 |
return enumType.getNote(); |
|
45 |
} |
|
46 |
} |
|
47 |
return null; |
|
48 |
} |
|
49 |
|
|
50 |
public static int getValueByNote(String givenNote) { |
|
51 |
for (CFG_LIGHT_INTENSITY_MODE enumType : CFG_LIGHT_INTENSITY_MODE.values()) { |
|
52 |
if (givenNote.equals(enumType.getNote())) { |
|
53 |
return enumType.getValue(); |
|
54 |
} |
|
55 |
} |
|
56 |
return -1; |
|
57 |
} |
|
58 |
|
|
59 |
public static CFG_LIGHT_INTENSITY_MODE getEnum(int value) { |
|
60 |
for (CFG_LIGHT_INTENSITY_MODE e : CFG_LIGHT_INTENSITY_MODE.values()) { |
|
61 |
if (e.getValue() == value){ |
|
62 |
return e; |
|
63 |
} |
|
64 |
} |
|
65 |
return CFG_LIGHT_INTENSITY_MODE.EM_LIGHT_INTENSITY_MODE_UNKNOW; |
|
66 |
} |
|
67 |
|
|
68 |
} |