提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 屏幕文本颜色 |
|
6 |
* @date 2022/11/28 16:20:21 |
|
7 |
*/ |
|
8 |
public enum EM_SCREEN_TEXT_COLOR { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_SCREEN_TEXT_COLOR_UNKNOWN(-1, "未知"), |
|
13 |
/** |
|
14 |
* 绿色 |
|
15 |
*/ |
|
16 |
EM_SCREEN_TEXT_COLOR_GREEN(0, "绿色"), |
|
17 |
/** |
|
18 |
* 红色 |
|
19 |
*/ |
|
20 |
EM_SCREEN_TEXT_COLOR_RED(1, "红色"), |
|
21 |
/** |
|
22 |
* 黄色 |
|
23 |
*/ |
|
24 |
EM_SCREEN_TEXT_COLOR_YELLOW(2, "黄色"), |
|
25 |
/** |
|
26 |
* 白色 |
|
27 |
*/ |
|
28 |
EM_SCREEN_TEXT_COLOR_WHITE(3, "白色"); |
|
29 |
|
|
30 |
private int value; |
|
31 |
|
|
32 |
private String note; |
|
33 |
|
|
34 |
public String getNote() { |
|
35 |
return note; |
|
36 |
} |
|
37 |
|
|
38 |
public int getValue() { |
|
39 |
return value; |
|
40 |
} |
|
41 |
|
|
42 |
EM_SCREEN_TEXT_COLOR(int givenValue, String note) { |
|
43 |
this.value = givenValue; |
|
44 |
this.note = note; |
|
45 |
} |
|
46 |
|
|
47 |
public static String getNoteByValue(int givenValue) { |
|
48 |
for (EM_SCREEN_TEXT_COLOR enumType : EM_SCREEN_TEXT_COLOR.values()) { |
|
49 |
if (givenValue == enumType.getValue()) { |
|
50 |
return enumType.getNote(); |
|
51 |
} |
|
52 |
} |
|
53 |
return null; |
|
54 |
} |
|
55 |
|
|
56 |
public static int getValueByNote(String givenNote) { |
|
57 |
for (EM_SCREEN_TEXT_COLOR enumType : EM_SCREEN_TEXT_COLOR.values()) { |
|
58 |
if (givenNote.equals(enumType.getNote())) { |
|
59 |
return enumType.getValue(); |
|
60 |
} |
|
61 |
} |
|
62 |
return -2; |
|
63 |
} |
|
64 |
} |