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