提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 车辆种类划分类型 |
|
6 |
* @date 2021/01/11 |
|
7 |
*/ |
|
8 |
public enum EM_VEHICLE_TYPE_SPLIT { |
|
9 |
// 未知 |
|
10 |
EM_VEHICLE_TYPE_SPLIT_UNKNOWN(0, "未知"), |
|
11 |
|
|
12 |
// 按功能划分 |
|
13 |
EM_VEHICLE_TYPE_SPLIT_FUNC(1, "按功能划分"), |
|
14 |
|
|
15 |
// 按标准划分 |
|
16 |
EM_VEHICLE_TYPE_SPLIT_STANDARD(2, "按标准划分"); |
|
17 |
|
|
18 |
private int value; |
|
19 |
private String note; |
|
20 |
|
|
21 |
private EM_VEHICLE_TYPE_SPLIT(int givenValue, String note) { |
|
22 |
this.value = givenValue; |
|
23 |
this.note = note; |
|
24 |
} |
|
25 |
|
|
26 |
public String getNote() { |
|
27 |
return note; |
|
28 |
} |
|
29 |
|
|
30 |
public int getValue() { |
|
31 |
return value; |
|
32 |
} |
|
33 |
|
|
34 |
public static String getNoteByValue(int givenValue) { |
|
35 |
for (EM_VEHICLE_TYPE_SPLIT enumType : EM_VEHICLE_TYPE_SPLIT.values()) { |
|
36 |
if (givenValue == enumType.getValue()) { |
|
37 |
return enumType.getNote(); |
|
38 |
} |
|
39 |
} |
|
40 |
return null; |
|
41 |
} |
|
42 |
|
|
43 |
public static int getValueByNote(String givenNote) { |
|
44 |
for (EM_VEHICLE_TYPE_SPLIT enumType : EM_VEHICLE_TYPE_SPLIT.values()) { |
|
45 |
if (givenNote.equals(enumType.getNote())) { |
|
46 |
return enumType.getValue(); |
|
47 |
} |
|
48 |
} |
|
49 |
return -1; |
|
50 |
} |
|
51 |
|
|
52 |
} |