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