提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 工装合规组类型 |
|
6 |
* @date 2022/10/08 17:05:54 |
|
7 |
*/ |
|
8 |
public enum EM_WORKSUIT_GROUP_TYPE { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_WORKSUIT_GROUP_TYPE_UNKNWON(0, "未知"), |
|
13 |
/** |
|
14 |
* 注册库(布控名单) |
|
15 |
*/ |
|
16 |
EM_WORKSUIT_GROUP_TYPE_BLOCK(1, "注册库(布控名单)"); |
|
17 |
|
|
18 |
private int value; |
|
19 |
|
|
20 |
private String note; |
|
21 |
|
|
22 |
public String getNote() { |
|
23 |
return note; |
|
24 |
} |
|
25 |
|
|
26 |
public int getValue() { |
|
27 |
return value; |
|
28 |
} |
|
29 |
|
|
30 |
EM_WORKSUIT_GROUP_TYPE(int givenValue, String note) { |
|
31 |
this.value = givenValue; |
|
32 |
this.note = note; |
|
33 |
} |
|
34 |
|
|
35 |
public static String getNoteByValue(int givenValue) { |
|
36 |
for (EM_WORKSUIT_GROUP_TYPE enumType : EM_WORKSUIT_GROUP_TYPE.values()) { |
|
37 |
if (givenValue == enumType.getValue()) { |
|
38 |
return enumType.getNote(); |
|
39 |
} |
|
40 |
} |
|
41 |
return null; |
|
42 |
} |
|
43 |
|
|
44 |
public static int getValueByNote(String givenNote) { |
|
45 |
for (EM_WORKSUIT_GROUP_TYPE enumType : EM_WORKSUIT_GROUP_TYPE.values()) { |
|
46 |
if (givenNote.equals(enumType.getNote())) { |
|
47 |
return enumType.getValue(); |
|
48 |
} |
|
49 |
} |
|
50 |
return -1; |
|
51 |
} |
|
52 |
|
|
53 |
} |