提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 260611 |
|
5 |
* @description 火灾配置类型 |
|
6 |
* @date 2023/05/24 10:24:48 |
|
7 |
*/ |
|
8 |
public enum NET_EM_FIREWARNING_MODE_TYPE { |
|
9 |
/** |
|
10 |
* 云台预置点模式(默认) |
|
11 |
*/ |
|
12 |
NET_EM_FIREWARNING_TYPE_PTZPRESET(0,"云台预置点模式(默认)"), |
|
13 |
/** |
|
14 |
* 空间排除模式 |
|
15 |
*/ |
|
16 |
NET_EM_FIREWARNING_TYPE_SPACEEXCLUDE(1,"空间排除模式"); |
|
17 |
|
|
18 |
private int value; |
|
19 |
|
|
20 |
private String note; |
|
21 |
|
|
22 |
public String getNote() { |
|
23 |
return note; |
|
24 |
} |
|
25 |
|
|
26 |
public int getValue() { |
|
27 |
return value; |
|
28 |
} |
|
29 |
|
|
30 |
NET_EM_FIREWARNING_MODE_TYPE(int givenValue, String note) { |
|
31 |
this.value = givenValue; |
|
32 |
this.note = note; |
|
33 |
} |
|
34 |
|
|
35 |
public static String getNoteByValue(int givenValue) { |
|
36 |
for (NET_EM_FIREWARNING_MODE_TYPE enumType : NET_EM_FIREWARNING_MODE_TYPE.values()) { |
|
37 |
if (givenValue == enumType.getValue()) { |
|
38 |
return enumType.getNote(); |
|
39 |
} |
|
40 |
} |
|
41 |
return null; |
|
42 |
} |
|
43 |
|
|
44 |
public static int getValueByNote(String givenNote) { |
|
45 |
for (NET_EM_FIREWARNING_MODE_TYPE enumType : NET_EM_FIREWARNING_MODE_TYPE.values()) { |
|
46 |
if (givenNote.equals(enumType.getNote())) { |
|
47 |
return enumType.getValue(); |
|
48 |
} |
|
49 |
} |
|
50 |
return -1; |
|
51 |
} |
|
52 |
|
|
53 |
public static NET_EM_FIREWARNING_MODE_TYPE getEnum(int value) { |
|
54 |
for (NET_EM_FIREWARNING_MODE_TYPE e : NET_EM_FIREWARNING_MODE_TYPE.values()) { |
|
55 |
if (e.getValue() == value) |
|
56 |
return e; |
|
57 |
} |
|
58 |
return NET_EM_FIREWARNING_MODE_TYPE.NET_EM_FIREWARNING_TYPE_PTZPRESET; |
|
59 |
} |
|
60 |
|
|
61 |
} |