提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 数据类型 |
|
6 |
* @date 2022/10/28 11:06:44 |
|
7 |
*/ |
|
8 |
public enum NET_EM_VS_DATA_TYPE { |
|
9 |
/** |
|
10 |
* 数据是当前人数的横坐标 |
|
11 |
*/ |
|
12 |
NET_EM_VS_DATA_TYPE_X(0, "数据是当前人数的横坐标"); |
|
13 |
|
|
14 |
private int value; |
|
15 |
|
|
16 |
private String note; |
|
17 |
|
|
18 |
public String getNote() { |
|
19 |
return note; |
|
20 |
} |
|
21 |
|
|
22 |
public int getValue() { |
|
23 |
return value; |
|
24 |
} |
|
25 |
|
|
26 |
NET_EM_VS_DATA_TYPE(int givenValue, String note) { |
|
27 |
this.value = givenValue; |
|
28 |
this.note = note; |
|
29 |
} |
|
30 |
|
|
31 |
public static String getNoteByValue(int givenValue) { |
|
32 |
for (NET_EM_VS_DATA_TYPE enumType : NET_EM_VS_DATA_TYPE.values()) { |
|
33 |
if (givenValue == enumType.getValue()) { |
|
34 |
return enumType.getNote(); |
|
35 |
} |
|
36 |
} |
|
37 |
return null; |
|
38 |
} |
|
39 |
|
|
40 |
public static int getValueByNote(String givenNote) { |
|
41 |
for (NET_EM_VS_DATA_TYPE enumType : NET_EM_VS_DATA_TYPE.values()) { |
|
42 |
if (givenNote.equals(enumType.getNote())) { |
|
43 |
return enumType.getValue(); |
|
44 |
} |
|
45 |
} |
|
46 |
return -1; |
|
47 |
} |
|
48 |
} |