提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @version 1.0 |
|
6 |
* @description 进口方向 |
|
7 |
* @date 2020/11/07 |
|
8 |
*/ |
|
9 |
public enum EM_ENTRY_DIRECTION { |
|
10 |
|
|
11 |
// 未知 |
|
12 |
EM_ENTRY_UNKNOWN(0, "未知"), |
|
13 |
// 北向南 |
|
14 |
EM_ENTRY_NORTH_TO_SOUTH(1, "北向南"), |
|
15 |
// 东北向西南 |
|
16 |
EM_ENTRY_EASTNORTH_TO_WESTSOUTH(2, "东北向西南"), |
|
17 |
// 东向西 |
|
18 |
EM_ENTRY_EAST_TO_WEST(3, "东向西"), |
|
19 |
// 东南向西北 |
|
20 |
EM_ENTRY_EASTSOUTH_TO_WESTNORTH(4, "东南向西北"), |
|
21 |
// 南向北 |
|
22 |
EM_ENTRY_SOUTH_TO_NORTH(5, "南向北"), |
|
23 |
// 西南向东北 |
|
24 |
EM_ENTRY_WESTSOUTH_TO_EASTSOUTH(6, "西南向东北"), |
|
25 |
// 西向东 |
|
26 |
EM_ENTRY_WEST_TO_EAST(7, "西向东"), |
|
27 |
// 西北向东南 |
|
28 |
EM_ENTRY_WESTNORTH_TO_EASTSOUTH(8, "西北向东南"); |
|
29 |
|
|
30 |
private int value; |
|
31 |
private String note; |
|
32 |
|
|
33 |
private EM_ENTRY_DIRECTION(int givenValue, String note) { |
|
34 |
this.value = givenValue; |
|
35 |
this.note = note; |
|
36 |
} |
|
37 |
|
|
38 |
public String getNote() { |
|
39 |
return note; |
|
40 |
} |
|
41 |
|
|
42 |
public int getValue() { |
|
43 |
return value; |
|
44 |
} |
|
45 |
|
|
46 |
public static String getNoteByValue(int givenValue) { |
|
47 |
for (EM_ENTRY_DIRECTION enumType : EM_ENTRY_DIRECTION.values()) { |
|
48 |
if (givenValue == enumType.getValue()) { |
|
49 |
return enumType.getNote(); |
|
50 |
} |
|
51 |
} |
|
52 |
return null; |
|
53 |
} |
|
54 |
|
|
55 |
public static int getValueByNote(String givenNote) { |
|
56 |
for (EM_ENTRY_DIRECTION enumType : EM_ENTRY_DIRECTION.values()) { |
|
57 |
if (givenNote.equals(enumType.getNote())) { |
|
58 |
return enumType.getValue(); |
|
59 |
} |
|
60 |
} |
|
61 |
return -1; |
|
62 |
} |
|
63 |
} |