提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 车位类型 |
|
6 |
* @date 2022/05/11 13:27:51 |
|
7 |
*/ |
|
8 |
public enum EM_SPACE_TYPE { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_SPACE_TYPE_UNKNOWN(-1, "未知"), |
|
13 |
/** |
|
14 |
* 小车位 |
|
15 |
*/ |
|
16 |
EM_SPACE_TYPE_CAR(0, "小车位"), |
|
17 |
/** |
|
18 |
* 大车位 |
|
19 |
*/ |
|
20 |
EM_SPACE_TYPE_BIG_CAR(1, "大车位"), |
|
21 |
/** |
|
22 |
* 危化品车位 |
|
23 |
*/ |
|
24 |
EM_SPACE_TYPE_HAZARDOUS_CHEMICALS(2, "危化品车位"), |
|
25 |
/** |
|
26 |
* 货车车位 |
|
27 |
*/ |
|
28 |
EM_SPACE_TYPE_TRUCK(3, "货车车位"), |
|
29 |
/** |
|
30 |
* 小客车车位 |
|
31 |
*/ |
|
32 |
EM_SPACE_TYPE_SMALL_TRUCK(4, "小客车车位"), |
|
33 |
/** |
|
34 |
* 大客车车位 |
|
35 |
*/ |
|
36 |
EM_SPACE_TYPE_BUS(5, "大客车车位"); |
|
37 |
|
|
38 |
private int value; |
|
39 |
|
|
40 |
private String note; |
|
41 |
|
|
42 |
public String getNote() { |
|
43 |
return note; |
|
44 |
} |
|
45 |
|
|
46 |
public int getValue() { |
|
47 |
return value; |
|
48 |
} |
|
49 |
|
|
50 |
EM_SPACE_TYPE(int givenValue, String note) { |
|
51 |
this.value = givenValue; |
|
52 |
this.note = note; |
|
53 |
} |
|
54 |
|
|
55 |
public static String getNoteByValue(int givenValue) { |
|
56 |
for (EM_SPACE_TYPE enumType : EM_SPACE_TYPE.values()) { |
|
57 |
if (givenValue == enumType.getValue()) { |
|
58 |
return enumType.getNote(); |
|
59 |
} |
|
60 |
} |
|
61 |
return null; |
|
62 |
} |
|
63 |
|
|
64 |
public static int getValueByNote(String givenNote) { |
|
65 |
for (EM_SPACE_TYPE enumType : EM_SPACE_TYPE.values()) { |
|
66 |
if (givenNote.equals(enumType.getNote())) { |
|
67 |
return enumType.getValue(); |
|
68 |
} |
|
69 |
} |
|
70 |
return -2; |
|
71 |
} |
|
72 |
|
|
73 |
public static EM_SPACE_TYPE getEnum(int value) { |
|
74 |
for (EM_SPACE_TYPE e : EM_SPACE_TYPE.values()) { |
|
75 |
if (e.getValue() == value) |
|
76 |
return e; |
|
77 |
} |
|
78 |
return EM_SPACE_TYPE.EM_SPACE_TYPE_UNKNOWN; |
|
79 |
} |
|
80 |
|
|
81 |
} |