提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 260611 |
|
6 |
* @description 收费公路车辆通行费车型分类 |
|
7 |
* @date 2022/07/20 16:46:40 |
|
8 |
*/ |
|
9 |
public enum EM_TOLLS_VEHICLE_TYPE { |
|
10 |
/** |
|
11 |
* 未知 |
|
12 |
*/ |
|
13 |
EM_TOLLS_VEHICLE_TYPE_UNKNOWN(0, "未知"), |
|
14 |
/** |
|
15 |
* 一型客车 |
|
16 |
*/ |
|
17 |
EM_TOLLS_VEHICLE_TYPE_PASSENGER_CAR1(1, "一型客车"), |
|
18 |
/** |
|
19 |
* 二型客车 |
|
20 |
*/ |
|
21 |
EM_TOLLS_VEHICLE_TYPE_PASSENGER_CAR2(2, "二型客车"), |
|
22 |
/** |
|
23 |
* 三型客车 |
|
24 |
*/ |
|
25 |
EM_TOLLS_VEHICLE_TYPE_PASSENGER_CAR3(3, "三型客车"), |
|
26 |
/** |
|
27 |
* 四型客车 |
|
28 |
*/ |
|
29 |
EM_TOLLS_VEHICLE_TYPE_PASSENGER_CAR4(4, "四型客车"), |
|
30 |
/** |
|
31 |
* 一型货车 |
|
32 |
*/ |
|
33 |
EM_TOLLS_VEHICLE_TYPE_TRUCK1(11, "一型货车"), |
|
34 |
/** |
|
35 |
* 二型货车 |
|
36 |
*/ |
|
37 |
EM_TOLLS_VEHICLE_TYPE_TRUCK2(12, "二型货车"), |
|
38 |
/** |
|
39 |
* 三型货车 |
|
40 |
*/ |
|
41 |
EM_TOLLS_VEHICLE_TYPE_TRUCK3(13, "三型货车"), |
|
42 |
/** |
|
43 |
* 四型货车 |
|
44 |
*/ |
|
45 |
EM_TOLLS_VEHICLE_TYPE_TRUCK4(14, "四型货车"), |
|
46 |
/** |
|
47 |
* 五型货车 |
|
48 |
*/ |
|
49 |
EM_TOLLS_VEHICLE_TYPE_TRUCK5(15, "五型货车"), |
|
50 |
/** |
|
51 |
* 六型货车 |
|
52 |
*/ |
|
53 |
EM_TOLLS_VEHICLE_TYPE_TRUCK6(16, "六型货车"), |
|
54 |
/** |
|
55 |
* 一型专项作业车 |
|
56 |
*/ |
|
57 |
EM_TOLLS_VEHICLE_TYPE_OPERATION_VEHICLE1(21, "一型专项作业车"), |
|
58 |
/** |
|
59 |
* 二型专项作业车 |
|
60 |
*/ |
|
61 |
EM_TOLLS_VEHICLE_TYPE_OPERATION_VEHICLE2(22, "二型专项作业车"), |
|
62 |
/** |
|
63 |
* 三型专项作业车 |
|
64 |
*/ |
|
65 |
EM_TOLLS_VEHICLE_TYPE_OPERATION_VEHICLE3(23, "三型专项作业车"), |
|
66 |
/** |
|
67 |
* 四型专项作业车 |
|
68 |
*/ |
|
69 |
EM_TOLLS_VEHICLE_TYPE_OPERATION_VEHICLE4(24, "四型专项作业车"), |
|
70 |
/** |
|
71 |
* 五型专项作业车 |
|
72 |
*/ |
|
73 |
EM_TOLLS_VEHICLE_TYPE_OPERATION_VEHICLE5(25, "五型专项作业车"), |
|
74 |
/** |
|
75 |
* 六型专项作业车 |
|
76 |
*/ |
|
77 |
EM_TOLLS_VEHICLE_TYPE_OPERATION_VEHICLE6(26, "六型专项作业车"); |
|
78 |
|
|
79 |
private int value; |
|
80 |
|
|
81 |
private String note; |
|
82 |
|
|
83 |
public String getNote() { |
|
84 |
return note; |
|
85 |
} |
|
86 |
|
|
87 |
public int getValue() { |
|
88 |
return value; |
|
89 |
} |
|
90 |
|
|
91 |
EM_TOLLS_VEHICLE_TYPE(int givenValue, String note) { |
|
92 |
this.value = givenValue; |
|
93 |
this.note = note; |
|
94 |
} |
|
95 |
|
|
96 |
public static String getNoteByValue(int givenValue) { |
|
97 |
for (EM_TOLLS_VEHICLE_TYPE enumType : EM_TOLLS_VEHICLE_TYPE.values()) { |
|
98 |
if (givenValue == enumType.getValue()) { |
|
99 |
return enumType.getNote(); |
|
100 |
} |
|
101 |
} |
|
102 |
return null; |
|
103 |
} |
|
104 |
|
|
105 |
public static int getValueByNote(String givenNote) { |
|
106 |
for (EM_TOLLS_VEHICLE_TYPE enumType : EM_TOLLS_VEHICLE_TYPE.values()) { |
|
107 |
if (givenNote.equals(enumType.getNote())) { |
|
108 |
return enumType.getValue(); |
|
109 |
} |
|
110 |
} |
|
111 |
return -1; |
|
112 |
} |
|
113 |
|
|
114 |
public static EM_TOLLS_VEHICLE_TYPE getEnum(int value) { |
|
115 |
for (EM_TOLLS_VEHICLE_TYPE e : EM_TOLLS_VEHICLE_TYPE.values()) { |
|
116 |
if (e.getValue() == value) |
|
117 |
return e; |
|
118 |
} |
|
119 |
return EM_TOLLS_VEHICLE_TYPE.EM_TOLLS_VEHICLE_TYPE_UNKNOWN; |
|
120 |
} |
|
121 |
|
|
122 |
} |