提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 260611 |
|
6 |
* @description 车牌属性 |
|
7 |
* @date 2023/01/10 19:44:59 |
|
8 |
*/ |
|
9 |
public enum EM_PLATE_ATTRIBUTE { |
|
10 |
/** |
|
11 |
* 未知 |
|
12 |
*/ |
|
13 |
EM_PLATE_ATTRIBUTE_UNKNOWN(0, "未知"), |
|
14 |
/** |
|
15 |
* 正常 |
|
16 |
*/ |
|
17 |
EM_PLATE_ATTRIBUTE_NORMAL(1, "正常"), |
|
18 |
/** |
|
19 |
* 无牌 |
|
20 |
*/ |
|
21 |
EM_PLATE_ATTRIBUTE_NO_PLATE(2, "无牌"), |
|
22 |
/** |
|
23 |
* 部分遮挡/污损 |
|
24 |
*/ |
|
25 |
EM_PLATE_ATTRIBUTE_PARTIAL_OCCLUSION(3, "部分遮挡/污损"), |
|
26 |
/** |
|
27 |
* 完全遮挡/污损 |
|
28 |
*/ |
|
29 |
EM_PLATE_ATTRIBUTE_FULL_OCCLUSION(4, "完全遮挡/污损"); |
|
30 |
|
|
31 |
private int value; |
|
32 |
|
|
33 |
private String note; |
|
34 |
|
|
35 |
public String getNote() { |
|
36 |
return note; |
|
37 |
} |
|
38 |
|
|
39 |
public int getValue() { |
|
40 |
return value; |
|
41 |
} |
|
42 |
|
|
43 |
EM_PLATE_ATTRIBUTE(int givenValue, String note) { |
|
44 |
this.value = givenValue; |
|
45 |
this.note = note; |
|
46 |
} |
|
47 |
|
|
48 |
public static String getNoteByValue(int givenValue) { |
|
49 |
for (EM_PLATE_ATTRIBUTE enumType : EM_PLATE_ATTRIBUTE.values()) { |
|
50 |
if (givenValue == enumType.getValue()) { |
|
51 |
return enumType.getNote(); |
|
52 |
} |
|
53 |
} |
|
54 |
return null; |
|
55 |
} |
|
56 |
|
|
57 |
public static int getValueByNote(String givenNote) { |
|
58 |
for (EM_PLATE_ATTRIBUTE enumType : EM_PLATE_ATTRIBUTE.values()) { |
|
59 |
if (givenNote.equals(enumType.getNote())) { |
|
60 |
return enumType.getValue(); |
|
61 |
} |
|
62 |
} |
|
63 |
return -1; |
|
64 |
} |
|
65 |
|
|
66 |
public static EM_PLATE_ATTRIBUTE getEnum(int value) { |
|
67 |
for (EM_PLATE_ATTRIBUTE e : EM_PLATE_ATTRIBUTE.values()) { |
|
68 |
if (e.getValue() == value) |
|
69 |
return e; |
|
70 |
} |
|
71 |
return EM_PLATE_ATTRIBUTE.EM_PLATE_ATTRIBUTE_UNKNOWN; |
|
72 |
} |
|
73 |
|
|
74 |
} |