提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 统计方向查询条件 |
|
6 |
* @date 2022/11/03 10:19:57 |
|
7 |
*/ |
|
8 |
public enum EM_STARTFIND_DIRECTION { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_STARTFIND_DIRECTION_UNKNOWN(0, "未知"), |
|
13 |
/** |
|
14 |
* 全部 |
|
15 |
*/ |
|
16 |
EM_STARTFIND_DIRECTION_BOTH(1, "全部"), |
|
17 |
/** |
|
18 |
* 左到右 |
|
19 |
*/ |
|
20 |
EM_STARTFIND_DIRECTION_LEFTTORIGHT(2, "左到右"), |
|
21 |
/** |
|
22 |
* 右到左 |
|
23 |
*/ |
|
24 |
EM_STARTFIND_DIRECTION_RIGHTTOLEFT(3, "右到左"); |
|
25 |
|
|
26 |
private int value; |
|
27 |
|
|
28 |
private String note; |
|
29 |
|
|
30 |
public String getNote() { |
|
31 |
return note; |
|
32 |
} |
|
33 |
|
|
34 |
public int getValue() { |
|
35 |
return value; |
|
36 |
} |
|
37 |
|
|
38 |
EM_STARTFIND_DIRECTION(int givenValue, String note) { |
|
39 |
this.value = givenValue; |
|
40 |
this.note = note; |
|
41 |
} |
|
42 |
|
|
43 |
public static String getNoteByValue(int givenValue) { |
|
44 |
for (EM_STARTFIND_DIRECTION enumType : EM_STARTFIND_DIRECTION.values()) { |
|
45 |
if (givenValue == enumType.getValue()) { |
|
46 |
return enumType.getNote(); |
|
47 |
} |
|
48 |
} |
|
49 |
return null; |
|
50 |
} |
|
51 |
|
|
52 |
public static int getValueByNote(String givenNote) { |
|
53 |
for (EM_STARTFIND_DIRECTION enumType : EM_STARTFIND_DIRECTION.values()) { |
|
54 |
if (givenNote.equals(enumType.getNote())) { |
|
55 |
return enumType.getValue(); |
|
56 |
} |
|
57 |
} |
|
58 |
return -1; |
|
59 |
} |
|
60 |
|
|
61 |
} |