提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author : 291189 |
|
5 |
* @since : Created in 2021/6/30 10:19 |
|
6 |
* 人员通过方向枚举 |
|
7 |
*/ |
|
8 |
public enum EM_SECURITYGATE_PERSON_PASS_DIRECTION { |
|
9 |
// 未知 |
|
10 |
EM_SECURITYGATE_PERSON_PASS_DIRECTION_UNKNOWN (0,"未知"), |
|
11 |
EM_SECURITYGATE_PERSON_PASS_DIRECTION_IN(1,"进入"), // 进入 |
|
12 |
EM_SECURITYGATE_PERSON_PASS_DIRECTION_OUT(2,"离开"); // 离开 |
|
13 |
|
|
14 |
private final int value; |
|
15 |
private final String note; |
|
16 |
|
|
17 |
EM_SECURITYGATE_PERSON_PASS_DIRECTION(int givenValue, String note) { |
|
18 |
this.value = givenValue; |
|
19 |
this.note = note; |
|
20 |
} |
|
21 |
|
|
22 |
public String getNote() { |
|
23 |
return note; |
|
24 |
} |
|
25 |
|
|
26 |
public int getValue() { |
|
27 |
return value; |
|
28 |
} |
|
29 |
|
|
30 |
public static String getNoteByValue(int givenValue) { |
|
31 |
for (EM_SECURITYGATE_PERSON_PASS_DIRECTION enumType : EM_SECURITYGATE_PERSON_PASS_DIRECTION.values()) { |
|
32 |
if (givenValue == enumType.getValue()) { |
|
33 |
return enumType.getNote(); |
|
34 |
} |
|
35 |
} |
|
36 |
return null; |
|
37 |
} |
|
38 |
|
|
39 |
public static int getValueByNote(String givenNote) { |
|
40 |
for (EM_SECURITYGATE_PERSON_PASS_DIRECTION enumType : EM_SECURITYGATE_PERSON_PASS_DIRECTION.values()) { |
|
41 |
if (givenNote.equals(enumType.getNote())) { |
|
42 |
return enumType.getValue(); |
|
43 |
} |
|
44 |
} |
|
45 |
return -1; |
|
46 |
} |
|
47 |
|
|
48 |
public static EM_SECURITYGATE_PERSON_PASS_DIRECTION getEnum(int value) { |
|
49 |
for (EM_SECURITYGATE_PERSON_PASS_DIRECTION e : EM_SECURITYGATE_PERSON_PASS_DIRECTION.values()) { |
|
50 |
if (e.getValue() == value) |
|
51 |
return e; |
|
52 |
} |
|
53 |
return EM_SECURITYGATE_PERSON_PASS_DIRECTION.EM_SECURITYGATE_PERSON_PASS_DIRECTION_UNKNOWN; |
|
54 |
} |
|
55 |
} |