提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 车道交通运行状态 |
|
6 |
* @date 2021/09/01 |
|
7 |
*/ |
|
8 |
public enum EM_LANE_RUNING_STATE { |
|
9 |
// 未知 |
|
10 |
EM_LANE_RUNING_UNKNOWN(0, "未知"), |
|
11 |
// 畅通 |
|
12 |
EM_LANE_RUNING_UNBLOCKED(1, "畅通"), |
|
13 |
// 基本畅通 |
|
14 |
EM_LANE_RUNING_BASIC_UNBLOCKED(2, "基本畅通"), |
|
15 |
// 轻度拥堵 |
|
16 |
EM_LANE_RUNING_LIGHT_CONGESTION(3, "轻度拥堵"), |
|
17 |
// 中度拥堵 |
|
18 |
EM_LANE_RUNING_MIDDLE_CONGESTION(4, "中度拥堵"), |
|
19 |
// 严重拥堵 |
|
20 |
EM_LANE_RUNING_SERIOUS_CONGESTION(5, "严重拥堵"); |
|
21 |
|
|
22 |
private int value; |
|
23 |
private String note; |
|
24 |
|
|
25 |
private EM_LANE_RUNING_STATE(int givenValue, String note) { |
|
26 |
this.value = givenValue; |
|
27 |
this.note = note; |
|
28 |
} |
|
29 |
|
|
30 |
public String getNote() { |
|
31 |
return note; |
|
32 |
} |
|
33 |
|
|
34 |
public int getValue() { |
|
35 |
return value; |
|
36 |
} |
|
37 |
|
|
38 |
public static String getNoteByValue(int givenValue) { |
|
39 |
for (EM_LANE_RUNING_STATE enumType : EM_LANE_RUNING_STATE.values()) { |
|
40 |
if (givenValue == enumType.getValue()) { |
|
41 |
return enumType.getNote(); |
|
42 |
} |
|
43 |
} |
|
44 |
return null; |
|
45 |
} |
|
46 |
|
|
47 |
public static int getValueByNote(String givenNote) { |
|
48 |
for (EM_LANE_RUNING_STATE enumType : EM_LANE_RUNING_STATE.values()) { |
|
49 |
if (givenNote.equals(enumType.getNote())) { |
|
50 |
return enumType.getValue(); |
|
51 |
} |
|
52 |
} |
|
53 |
return -1; |
|
54 |
} |
|
55 |
} |