提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 数据来源 |
|
7 |
* @origin autoTool |
|
8 |
* @date 2023/09/06 15:55:03 |
|
9 |
*/ |
|
10 |
public enum EM_DATE_SOURCE { |
|
11 |
/** |
|
12 |
* GPS |
|
13 |
*/ |
|
14 |
EM_DATE_SOURCE_GPS(0,"GPS"), |
|
15 |
/** |
|
16 |
* 惯性导航数据 |
|
17 |
*/ |
|
18 |
EM_DATE_SOURCE_INERTIALNAVIGATION(1,"惯性导航数据"); |
|
19 |
|
|
20 |
private int value; |
|
21 |
|
|
22 |
private String note; |
|
23 |
|
|
24 |
public String getNote() { |
|
25 |
return note; |
|
26 |
} |
|
27 |
|
|
28 |
public int getValue() { |
|
29 |
return value; |
|
30 |
} |
|
31 |
|
|
32 |
EM_DATE_SOURCE(int givenValue, String note) { |
|
33 |
this.value = givenValue; |
|
34 |
this.note = note; |
|
35 |
} |
|
36 |
|
|
37 |
public static String getNoteByValue(int givenValue) { |
|
38 |
for (EM_DATE_SOURCE enumType : EM_DATE_SOURCE.values()) { |
|
39 |
if (givenValue == enumType.getValue()) { |
|
40 |
return enumType.getNote(); |
|
41 |
} |
|
42 |
} |
|
43 |
return null; |
|
44 |
} |
|
45 |
|
|
46 |
public static int getValueByNote(String givenNote) { |
|
47 |
for (EM_DATE_SOURCE enumType : EM_DATE_SOURCE.values()) { |
|
48 |
if (givenNote.equals(enumType.getNote())) { |
|
49 |
return enumType.getValue(); |
|
50 |
} |
|
51 |
} |
|
52 |
return -1; |
|
53 |
} |
|
54 |
|
|
55 |
public static EM_DATE_SOURCE getEnum(int value) { |
|
56 |
for (EM_DATE_SOURCE e : EM_DATE_SOURCE.values()) { |
|
57 |
if (e.getValue() == value){ |
|
58 |
return e; |
|
59 |
} |
|
60 |
} |
|
61 |
return EM_DATE_SOURCE.EM_DATE_SOURCE_GPS; |
|
62 |
} |
|
63 |
|
|
64 |
} |