提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 421657 |
|
6 |
* @description 任务名称 |
|
7 |
* @origin autoTool |
|
8 |
* @date 2023/10/16 19:23:11 |
|
9 |
*/ |
|
10 |
public enum EM_PTZ_TASK_NAME { |
|
11 |
/** |
|
12 |
* 未知 |
|
13 |
*/ |
|
14 |
NET_EM_PTZ_TASK_NAME_UNKNOWN(0, "未知"), |
|
15 |
/** |
|
16 |
* 定时任务 |
|
17 |
*/ |
|
18 |
NET_EM_PTZ_TASK_NAME_AUTOMOVEMENT(1, "定时任务"), |
|
19 |
/** |
|
20 |
* 空闲任务 |
|
21 |
*/ |
|
22 |
NET_EM_PTZ_TASK_NAME_IDLEMOTION(2, "空闲任务"), |
|
23 |
/** |
|
24 |
* 开机动作 |
|
25 |
*/ |
|
26 |
NET_EM_PTZ_TASK_NAME_POWERUP(3, "开机动作"), |
|
27 |
/** |
|
28 |
* 云台联动 |
|
29 |
*/ |
|
30 |
NET_EM_PTZ_TASK_NAME_LINK(4, "云台联动"), |
|
31 |
/** |
|
32 |
* 智能 |
|
33 |
*/ |
|
34 |
NET_EM_PTZ_TASK_NAME_INTELIGENCE(5, "智能"), |
|
35 |
/** |
|
36 |
* 手动 |
|
37 |
*/ |
|
38 |
NET_EM_PTZ_TASK_NAME_MANUAL(6, "手动"); |
|
39 |
|
|
40 |
private int value; |
|
41 |
|
|
42 |
private String note; |
|
43 |
|
|
44 |
public String getNote() { |
|
45 |
return note; |
|
46 |
} |
|
47 |
|
|
48 |
public int getValue() { |
|
49 |
return value; |
|
50 |
} |
|
51 |
|
|
52 |
EM_PTZ_TASK_NAME(int givenValue, String note) { |
|
53 |
this.value = givenValue; |
|
54 |
this.note = note; |
|
55 |
} |
|
56 |
|
|
57 |
public static String getNoteByValue(int givenValue) { |
|
58 |
for (EM_PTZ_TASK_NAME enumType : EM_PTZ_TASK_NAME.values()) { |
|
59 |
if (givenValue == enumType.getValue()) { |
|
60 |
return enumType.getNote(); |
|
61 |
} |
|
62 |
} |
|
63 |
return null; |
|
64 |
} |
|
65 |
|
|
66 |
public static int getValueByNote(String givenNote) { |
|
67 |
for (EM_PTZ_TASK_NAME enumType : EM_PTZ_TASK_NAME.values()) { |
|
68 |
if (givenNote.equals(enumType.getNote())) { |
|
69 |
return enumType.getValue(); |
|
70 |
} |
|
71 |
} |
|
72 |
return -1; |
|
73 |
} |
|
74 |
|
|
75 |
public static EM_PTZ_TASK_NAME getEnum(int value) { |
|
76 |
for (EM_PTZ_TASK_NAME e : EM_PTZ_TASK_NAME.values()) { |
|
77 |
if (e.getValue() == value) { |
|
78 |
return e; |
|
79 |
} |
|
80 |
} |
|
81 |
return EM_PTZ_TASK_NAME.NET_EM_PTZ_TASK_NAME_UNKNOWN; |
|
82 |
} |
|
83 |
|
|
84 |
} |