提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 291189 |
|
5 |
* @version 1.0 |
|
6 |
* @description |
|
7 |
* @date 2021/8/20 11:48 |
|
8 |
*/ |
|
9 |
public enum EM_TEST_ITEMS { |
|
10 |
EM_TEST_ITEMS_UNKNOWN(-1,"未知"), // 未知 |
|
11 |
EM_TEST_ITEMS_OTHER(0,"其他项目"), // 其他项目 |
|
12 |
EM_TEST_ITEMS_HAND_TEST(1,"手部测试静电电阻"), // 手部测试静电电阻 |
|
13 |
EM_TEST_ITEMS_TWOFEET_TEST(2,"双脚测试静电电阻"), // 双脚测试静电电阻 |
|
14 |
EM_TEST_ITEMS_HANDTWOFEET_TEST(3,"手部和双脚测试静电电阻"), // 手部和双脚测试静电电阻 |
|
15 |
EM_TEST_ITEMS_NONE(4,"全部不测"); // 全部不测 |
|
16 |
|
|
17 |
private final int value; |
|
18 |
private final String note; |
|
19 |
|
|
20 |
EM_TEST_ITEMS(int givenValue, String note) { |
|
21 |
this.value = givenValue; |
|
22 |
this.note = note; |
|
23 |
} |
|
24 |
|
|
25 |
public String getNote() { |
|
26 |
return note; |
|
27 |
} |
|
28 |
|
|
29 |
public int getValue() { |
|
30 |
return value; |
|
31 |
} |
|
32 |
|
|
33 |
public static String getNoteByValue(int givenValue) { |
|
34 |
for (EM_TEST_ITEMS enumType : EM_TEST_ITEMS.values()) { |
|
35 |
if (givenValue == enumType.getValue()) { |
|
36 |
return enumType.getNote(); |
|
37 |
} |
|
38 |
} |
|
39 |
return null; |
|
40 |
} |
|
41 |
|
|
42 |
public static int getValueByNote(String givenNote) { |
|
43 |
for (EM_TEST_ITEMS enumType : EM_TEST_ITEMS.values()) { |
|
44 |
if (givenNote.equals(enumType.getNote())) { |
|
45 |
return enumType.getValue(); |
|
46 |
} |
|
47 |
} |
|
48 |
return -1; |
|
49 |
} |
|
50 |
|
|
51 |
public static EM_TEST_ITEMS getEnum(int value) { |
|
52 |
for (EM_TEST_ITEMS e : EM_TEST_ITEMS.values()) { |
|
53 |
if (e.getValue() == value) |
|
54 |
return e; |
|
55 |
} |
|
56 |
return EM_TEST_ITEMS.EM_TEST_ITEMS_UNKNOWN; |
|
57 |
} |
|
58 |
|
|
59 |
} |