提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 251823 |
|
6 |
* @description 是否穿着防火衣 |
|
7 |
* @date 2022/11/01 19:47:04 |
|
8 |
*/ |
|
9 |
public enum EM_FIREPROOF_CLOTHES_STATE { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_FIREPROOF_CLOTHES_STATE_UNKNOWN(0,"未知"), |
|
14 |
/** |
|
15 |
没有穿着防火衣 |
|
16 |
*/ |
|
17 |
EM_FIREPROOF_CLOTHES_STATE_NO(1,"没有穿着防火衣"), |
|
18 |
/** |
|
19 |
有穿着防火衣 |
|
20 |
*/ |
|
21 |
EM_FIREPROOF_CLOTHES_STATE_YES(2,"有穿着防火衣"), |
|
22 |
/** |
|
23 |
不存在指定颜色的防火衣 |
|
24 |
*/ |
|
25 |
EM_FIREPROOF_CLOTHES_STATE_NOEXIT(3,"不存在指定颜色的防火衣"); |
|
26 |
|
|
27 |
private int value; |
|
28 |
|
|
29 |
private String note; |
|
30 |
|
|
31 |
public String getNote() { |
|
32 |
return note; |
|
33 |
} |
|
34 |
|
|
35 |
public int getValue() { |
|
36 |
return value; |
|
37 |
} |
|
38 |
|
|
39 |
EM_FIREPROOF_CLOTHES_STATE(int givenValue, String note) { |
|
40 |
this.value = givenValue; |
|
41 |
this.note = note; |
|
42 |
} |
|
43 |
|
|
44 |
public static String getNoteByValue(int givenValue) { |
|
45 |
for (EM_FIREPROOF_CLOTHES_STATE enumType : EM_FIREPROOF_CLOTHES_STATE.values()) { |
|
46 |
if (givenValue == enumType.getValue()) { |
|
47 |
return enumType.getNote(); |
|
48 |
} |
|
49 |
} |
|
50 |
return null; |
|
51 |
} |
|
52 |
|
|
53 |
public static int getValueByNote(String givenNote) { |
|
54 |
for (EM_FIREPROOF_CLOTHES_STATE enumType : EM_FIREPROOF_CLOTHES_STATE.values()) { |
|
55 |
if (givenNote.equals(enumType.getNote())) { |
|
56 |
return enumType.getValue(); |
|
57 |
} |
|
58 |
} |
|
59 |
return -1; |
|
60 |
} |
|
61 |
|
|
62 |
public static EM_FIREPROOF_CLOTHES_STATE getEnum(int value) { |
|
63 |
for (EM_FIREPROOF_CLOTHES_STATE e : EM_FIREPROOF_CLOTHES_STATE.values()) { |
|
64 |
if (e.getValue() == value) |
|
65 |
return e; |
|
66 |
} |
|
67 |
return EM_FIREPROOF_CLOTHES_STATE.EM_FIREPROOF_CLOTHES_STATE_UNKNOWN; |
|
68 |
} |
|
69 |
|
|
70 |
} |