提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 291189 |
|
5 |
* @description 区域防区操作用户 |
|
6 |
* @date 2022/07/19 10:09:08 |
|
7 |
*/ |
|
8 |
public enum EM_AREAARM_USER { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_AREAARM_USER_UNKNOWN(0, "未知"), |
|
13 |
/** |
|
14 |
* |
|
15 |
*/ |
|
16 |
EM_AREAARM_USER_SUPERVISOR(1, ""), |
|
17 |
/** |
|
18 |
* 管理用户 |
|
19 |
*/ |
|
20 |
EM_AREAARM_USER_MANAGER(2, "管理用户"), |
|
21 |
/** |
|
22 |
* 主用户 |
|
23 |
*/ |
|
24 |
EM_AREAARM_USER_MASTER(3, "主用户"), |
|
25 |
/** |
|
26 |
* 普通用户 |
|
27 |
*/ |
|
28 |
EM_AREAARM_USER_USER(4, "普通用户"), |
|
29 |
/** |
|
30 |
* 临时用户 |
|
31 |
*/ |
|
32 |
EM_AREAARM_USER_TEMPORARY(5, "临时用户"), |
|
33 |
/** |
|
34 |
* 胁迫用户 |
|
35 |
*/ |
|
36 |
EM_AREAARM_USER_DURESS(6, "胁迫用户"), |
|
37 |
/** |
|
38 |
* 巡逻用户 |
|
39 |
*/ |
|
40 |
EM_AREAARM_USER_PATROL(7, "巡逻用户"); |
|
41 |
|
|
42 |
private int value; |
|
43 |
|
|
44 |
private String note; |
|
45 |
|
|
46 |
public String getNote() { |
|
47 |
return note; |
|
48 |
} |
|
49 |
|
|
50 |
public int getValue() { |
|
51 |
return value; |
|
52 |
} |
|
53 |
|
|
54 |
EM_AREAARM_USER(int givenValue, String note) { |
|
55 |
this.value = givenValue; |
|
56 |
this.note = note; |
|
57 |
} |
|
58 |
|
|
59 |
public static String getNoteByValue(int givenValue) { |
|
60 |
for (EM_AREAARM_USER enumType : EM_AREAARM_USER.values()) { |
|
61 |
if (givenValue == enumType.getValue()) { |
|
62 |
return enumType.getNote(); |
|
63 |
} |
|
64 |
} |
|
65 |
return null; |
|
66 |
} |
|
67 |
|
|
68 |
public static int getValueByNote(String givenNote) { |
|
69 |
for (EM_AREAARM_USER enumType : EM_AREAARM_USER.values()) { |
|
70 |
if (givenNote.equals(enumType.getNote())) { |
|
71 |
return enumType.getValue(); |
|
72 |
} |
|
73 |
} |
|
74 |
return -1; |
|
75 |
} |
|
76 |
|
|
77 |
public static EM_AREAARM_USER getEnum(int value) { |
|
78 |
for (EM_AREAARM_USER e : EM_AREAARM_USER.values()) { |
|
79 |
if (e.getValue() == value) |
|
80 |
return e; |
|
81 |
} |
|
82 |
return EM_AREAARM_USER.EM_AREAARM_USER_UNKNOWN; |
|
83 |
} |
|
84 |
|
|
85 |
} |