提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 260611 |
|
5 |
* @description 是否为非新能源车辆 |
|
6 |
* @origin autoTool |
|
7 |
* @date 2023/06/20 10:13:16 |
|
8 |
*/ |
|
9 |
public enum EM_NON_NEW_ENERGY_CAR { |
|
10 |
/** |
|
11 |
* 未知 |
|
12 |
*/ |
|
13 |
EM_NON_NEW_ENERGY_CAR_UNKNOWN(0,"未知"), |
|
14 |
/** |
|
15 |
* 新能源车辆 |
|
16 |
*/ |
|
17 |
EM_NON_NEW_ENERGY_CAR_NO(1,"新能源车辆"), |
|
18 |
/** |
|
19 |
* 非新能源车辆 |
|
20 |
*/ |
|
21 |
EM_NON_NEW_ENERGY_CAR_YES(2,"非新能源车辆"); |
|
22 |
|
|
23 |
private int value; |
|
24 |
|
|
25 |
private String note; |
|
26 |
|
|
27 |
public String getNote() { |
|
28 |
return note; |
|
29 |
} |
|
30 |
|
|
31 |
public int getValue() { |
|
32 |
return value; |
|
33 |
} |
|
34 |
|
|
35 |
EM_NON_NEW_ENERGY_CAR(int givenValue, String note) { |
|
36 |
this.value = givenValue; |
|
37 |
this.note = note; |
|
38 |
} |
|
39 |
|
|
40 |
public static String getNoteByValue(int givenValue) { |
|
41 |
for (EM_NON_NEW_ENERGY_CAR enumType : EM_NON_NEW_ENERGY_CAR.values()) { |
|
42 |
if (givenValue == enumType.getValue()) { |
|
43 |
return enumType.getNote(); |
|
44 |
} |
|
45 |
} |
|
46 |
return null; |
|
47 |
} |
|
48 |
|
|
49 |
public static int getValueByNote(String givenNote) { |
|
50 |
for (EM_NON_NEW_ENERGY_CAR enumType : EM_NON_NEW_ENERGY_CAR.values()) { |
|
51 |
if (givenNote.equals(enumType.getNote())) { |
|
52 |
return enumType.getValue(); |
|
53 |
} |
|
54 |
} |
|
55 |
return -1; |
|
56 |
} |
|
57 |
|
|
58 |
public static EM_NON_NEW_ENERGY_CAR getEnum(int value) { |
|
59 |
for (EM_NON_NEW_ENERGY_CAR e : EM_NON_NEW_ENERGY_CAR.values()) { |
|
60 |
if (e.getValue() == value) |
|
61 |
return e; |
|
62 |
} |
|
63 |
return EM_NON_NEW_ENERGY_CAR.EM_NON_NEW_ENERGY_CAR_UNKNOWN; |
|
64 |
} |
|
65 |
|
|
66 |
} |