提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* 红绿灯触发源 |
|
5 |
* |
|
6 |
* @author : 47040 |
|
7 |
* @since : Created in 2020/8/29 16:43 |
|
8 |
*/ |
|
9 |
public enum EM_TRFAFFIC_LIGHT_SOURCE { |
|
10 |
|
|
11 |
/** |
|
12 |
* 未知 |
|
13 |
*/ |
|
14 |
EM_TRFAFFIC_LIGHT_SOURCE_UNKNOWN(0, "未知"), |
|
15 |
/** |
|
16 |
* 信号检测器 |
|
17 |
*/ |
|
18 |
EM_TRFAFFIC_LIGHT_SOURCE_SIGNAL(1, "信号检测器"), |
|
19 |
/** |
|
20 |
* DSP(算法检测) |
|
21 |
*/ |
|
22 |
EM_TRFAFFIC_LIGHT_SOURCE_DSP(2, "DSP(算法检测)"), |
|
23 |
/** |
|
24 |
* 网络信号检测器 |
|
25 |
*/ |
|
26 |
EM_TRFAFFIC_LIGHT_SOURCE_NET_SIGNAL(3, "网络信号检测器"); |
|
27 |
|
|
28 |
private int value; |
|
29 |
private String note; |
|
30 |
|
|
31 |
EM_TRFAFFIC_LIGHT_SOURCE(int givenValue, String note) { |
|
32 |
this.value = givenValue; |
|
33 |
this.note = note; |
|
34 |
} |
|
35 |
|
|
36 |
public String getNote() { |
|
37 |
return note; |
|
38 |
} |
|
39 |
|
|
40 |
public int getValue() { |
|
41 |
return value; |
|
42 |
} |
|
43 |
|
|
44 |
public static String getNoteByValue(int givenValue) { |
|
45 |
for (EM_TRFAFFIC_LIGHT_SOURCE enumType : EM_TRFAFFIC_LIGHT_SOURCE.values()) { |
|
46 |
if (givenValue == enumType.getValue()) { |
|
47 |
return enumType.getNote(); |
|
48 |
} |
|
49 |
} |
|
50 |
return null; |
|
51 |
} |
|
52 |
|
|
53 |
public static int getValueByNote(String givenNote) { |
|
54 |
for (EM_TRFAFFIC_LIGHT_SOURCE enumType : EM_TRFAFFIC_LIGHT_SOURCE.values()) { |
|
55 |
if (givenNote.equals(enumType.getNote())) { |
|
56 |
return enumType.getValue(); |
|
57 |
} |
|
58 |
} |
|
59 |
return -1; |
|
60 |
} |
|
61 |
} |