提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 可选择特写模式 |
|
6 |
* @date 2021/01/11 |
|
7 |
*/ |
|
8 |
public enum EM_SUPPORT_CLOSE_UP_TYPE { |
|
9 |
// 未知 |
|
10 |
EM_SUPPORT_CLOSE_UP_TYPE_UNKNOWN(0, "未知"), |
|
11 |
|
|
12 |
// 跟踪模式 |
|
13 |
EM_SUPPORT_CLOSE_UP_TYPE_TRACK_MODE(1, "跟踪模式"), |
|
14 |
|
|
15 |
// 固定模式 |
|
16 |
EM_SUPPORT_CLOSE_UP_TYPE_FIXED_MODE(2, "固定模式"), |
|
17 |
|
|
18 |
// 指定区域模式 |
|
19 |
EM_SUPPORT_CLOSE_UP_TYPE_DESIGNED_REGION_MODE(3, "指定区域模式"); |
|
20 |
|
|
21 |
private int value; |
|
22 |
private String note; |
|
23 |
|
|
24 |
private EM_SUPPORT_CLOSE_UP_TYPE(int givenValue, String note) { |
|
25 |
this.value = givenValue; |
|
26 |
this.note = note; |
|
27 |
} |
|
28 |
|
|
29 |
public String getNote() { |
|
30 |
return note; |
|
31 |
} |
|
32 |
|
|
33 |
public int getValue() { |
|
34 |
return value; |
|
35 |
} |
|
36 |
|
|
37 |
public static String getNoteByValue(int givenValue) { |
|
38 |
for (EM_SUPPORT_CLOSE_UP_TYPE enumType : EM_SUPPORT_CLOSE_UP_TYPE.values()) { |
|
39 |
if (givenValue == enumType.getValue()) { |
|
40 |
return enumType.getNote(); |
|
41 |
} |
|
42 |
} |
|
43 |
return null; |
|
44 |
} |
|
45 |
|
|
46 |
public static int getValueByNote(String givenNote) { |
|
47 |
for (EM_SUPPORT_CLOSE_UP_TYPE enumType : EM_SUPPORT_CLOSE_UP_TYPE.values()) { |
|
48 |
if (givenNote.equals(enumType.getNote())) { |
|
49 |
return enumType.getValue(); |
|
50 |
} |
|
51 |
} |
|
52 |
return -1; |
|
53 |
} |
|
54 |
} |