提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author : 260611 |
|
6 |
* @description : 动物检测规则下的场景类型 |
|
7 |
* @since : Created in 2021/11/05 15:07 |
|
8 |
*/ |
|
9 |
|
|
10 |
public enum EM_DETECTION_SCENE_TYPE { |
|
11 |
/** |
|
12 |
* 未知 |
|
13 |
*/ |
|
14 |
EM_DETECTION_SCENE_TYPE_UNKNOWN(0,"未知"), |
|
15 |
/** |
|
16 |
* 兽类场景,可检测动物、人、车 |
|
17 |
*/ |
|
18 |
EM_DETECTION_SCENE_TYPE_ANIMAL(1,"兽类场景,可检测动物、人、车"), |
|
19 |
/** |
|
20 |
* 鸟类场景,可检测鸟类,人、车 |
|
21 |
*/ |
|
22 |
EM_DETECTION_SCENE_TYPE_BIRD(2,"鸟类场景,可检测鸟类,人、车"), |
|
23 |
/** |
|
24 |
* 猪类场景,可检测猪只 |
|
25 |
*/ |
|
26 |
EM_DETECTION_SCENE_TYPE_PIG(3, "猪类场景,可检测猪只"); |
|
27 |
|
|
28 |
private int value; |
|
29 |
|
|
30 |
private String note; |
|
31 |
|
|
32 |
public String getNote() { |
|
33 |
return note; |
|
34 |
} |
|
35 |
|
|
36 |
public int getValue() { |
|
37 |
return value; |
|
38 |
} |
|
39 |
|
|
40 |
EM_DETECTION_SCENE_TYPE(int givenValue, String note) { |
|
41 |
this.value = givenValue; |
|
42 |
this.note = note; |
|
43 |
} |
|
44 |
|
|
45 |
public static String getNoteByValue(int givenValue) { |
|
46 |
for (EM_DETECTION_SCENE_TYPE enumType : EM_DETECTION_SCENE_TYPE.values()) { |
|
47 |
if (givenValue == enumType.getValue()) { |
|
48 |
return enumType.getNote(); |
|
49 |
} |
|
50 |
} |
|
51 |
return null; |
|
52 |
} |
|
53 |
|
|
54 |
public static int getValueByNote(String givenNote) { |
|
55 |
for (EM_DETECTION_SCENE_TYPE enumType : EM_DETECTION_SCENE_TYPE.values()) { |
|
56 |
if (givenNote.equals(enumType.getNote())) { |
|
57 |
return enumType.getValue(); |
|
58 |
} |
|
59 |
} |
|
60 |
return -1; |
|
61 |
} |
|
62 |
|
|
63 |
public static EM_DETECTION_SCENE_TYPE getEnum(int value) { |
|
64 |
for (EM_DETECTION_SCENE_TYPE e : EM_DETECTION_SCENE_TYPE.values()) { |
|
65 |
if (e.getValue() == value) |
|
66 |
return e; |
|
67 |
} |
|
68 |
return EM_DETECTION_SCENE_TYPE.EM_DETECTION_SCENE_TYPE_UNKNOWN; |
|
69 |
} |
|
70 |
|
|
71 |
} |