提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 251823 |
|
6 |
* @description 眼镜检测规则中报警类型 |
|
7 |
* @date 2022/11/01 19:47:17 |
|
8 |
*/ |
|
9 |
public enum EM_GLASSES_RULE_TYPE { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_GLASSES_RULE_TYPE_UNKNOWN(-1,"未知"), |
|
14 |
/** |
|
15 |
无眼镜 |
|
16 |
*/ |
|
17 |
EM_GLASSES_RULE_TYPE_NO_GLASSES(0,"无眼镜"), |
|
18 |
/** |
|
19 |
太阳镜 |
|
20 |
*/ |
|
21 |
EM_GLASSES_RULE_TYPE_SUN_GLASSES(1,"太阳镜"), |
|
22 |
/** |
|
23 |
黑框眼镜 |
|
24 |
*/ |
|
25 |
EM_GLASSES_RULE_TYPE_BLACK_RIMMED_GLASSES(2,"黑框眼镜"), |
|
26 |
/** |
|
27 |
半框眼镜 |
|
28 |
*/ |
|
29 |
EM_GLASSES_RULE_TYPE_HALF_RIMMED_GLASSES(3,"半框眼镜"), |
|
30 |
/** |
|
31 |
无框眼镜 |
|
32 |
*/ |
|
33 |
EM_GLASSES_RULE_TYPE_RIMLESS_GLASSES(4,"无框眼镜"), |
|
34 |
/** |
|
35 |
普通眼镜 |
|
36 |
*/ |
|
37 |
EM_GLASSES_RULE_TYPE_NORMAL_GLASSES(5,"普通眼镜"), |
|
38 |
/** |
|
39 |
工业护目镜 |
|
40 |
*/ |
|
41 |
EM_GLASSES_RULE_TYPE_INDUSTRIAL_SAFETY_GLASSES(6,"工业护目镜"); |
|
42 |
|
|
43 |
private int value; |
|
44 |
|
|
45 |
private String note; |
|
46 |
|
|
47 |
public String getNote() { |
|
48 |
return note; |
|
49 |
} |
|
50 |
|
|
51 |
public int getValue() { |
|
52 |
return value; |
|
53 |
} |
|
54 |
|
|
55 |
EM_GLASSES_RULE_TYPE(int givenValue, String note) { |
|
56 |
this.value = givenValue; |
|
57 |
this.note = note; |
|
58 |
} |
|
59 |
|
|
60 |
public static String getNoteByValue(int givenValue) { |
|
61 |
for (EM_GLASSES_RULE_TYPE enumType : EM_GLASSES_RULE_TYPE.values()) { |
|
62 |
if (givenValue == enumType.getValue()) { |
|
63 |
return enumType.getNote(); |
|
64 |
} |
|
65 |
} |
|
66 |
return null; |
|
67 |
} |
|
68 |
|
|
69 |
public static int getValueByNote(String givenNote) { |
|
70 |
for (EM_GLASSES_RULE_TYPE enumType : EM_GLASSES_RULE_TYPE.values()) { |
|
71 |
if (givenNote.equals(enumType.getNote())) { |
|
72 |
return enumType.getValue(); |
|
73 |
} |
|
74 |
} |
|
75 |
return -2; |
|
76 |
} |
|
77 |
|
|
78 |
public static EM_GLASSES_RULE_TYPE getEnum(int value) { |
|
79 |
for (EM_GLASSES_RULE_TYPE e : EM_GLASSES_RULE_TYPE.values()) { |
|
80 |
if (e.getValue() == value) |
|
81 |
return e; |
|
82 |
} |
|
83 |
return EM_GLASSES_RULE_TYPE.EM_GLASSES_RULE_TYPE_UNKNOWN; |
|
84 |
} |
|
85 |
|
|
86 |
} |