提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 目标类型 |
|
7 |
* @origin autoTool |
|
8 |
* @date 2023/09/22 13:56:24 |
|
9 |
*/ |
|
10 |
public enum EM_TRACK_OBJECT_TYPE { |
|
11 |
/** |
|
12 |
* 未知 |
|
13 |
*/ |
|
14 |
EM_TRACK_OBJECT_TYPE_UNKNOWN(-1,"未知"), |
|
15 |
/** |
|
16 |
* 目标 |
|
17 |
*/ |
|
18 |
EM_TRACK_OBJECT_TYPE_FACE(0,"目标"), |
|
19 |
/** |
|
20 |
* 人体 |
|
21 |
*/ |
|
22 |
EM_TRACK_OBJECT_TYPE_HUMAN(1,"人体"), |
|
23 |
/** |
|
24 |
* 机动车 |
|
25 |
*/ |
|
26 |
EM_TRACK_OBJECT_TYPE_VECHILE(2,"机动车"), |
|
27 |
/** |
|
28 |
* 非机动车 |
|
29 |
*/ |
|
30 |
EM_TRACK_OBJECT_TYPE_NOMOTOR(3,"非机动车"); |
|
31 |
|
|
32 |
private int value; |
|
33 |
|
|
34 |
private String note; |
|
35 |
|
|
36 |
public String getNote() { |
|
37 |
return note; |
|
38 |
} |
|
39 |
|
|
40 |
public int getValue() { |
|
41 |
return value; |
|
42 |
} |
|
43 |
|
|
44 |
EM_TRACK_OBJECT_TYPE(int givenValue, String note) { |
|
45 |
this.value = givenValue; |
|
46 |
this.note = note; |
|
47 |
} |
|
48 |
|
|
49 |
public static String getNoteByValue(int givenValue) { |
|
50 |
for (EM_TRACK_OBJECT_TYPE enumType : EM_TRACK_OBJECT_TYPE.values()) { |
|
51 |
if (givenValue == enumType.getValue()) { |
|
52 |
return enumType.getNote(); |
|
53 |
} |
|
54 |
} |
|
55 |
return null; |
|
56 |
} |
|
57 |
|
|
58 |
public static int getValueByNote(String givenNote) { |
|
59 |
for (EM_TRACK_OBJECT_TYPE enumType : EM_TRACK_OBJECT_TYPE.values()) { |
|
60 |
if (givenNote.equals(enumType.getNote())) { |
|
61 |
return enumType.getValue(); |
|
62 |
} |
|
63 |
} |
|
64 |
return -2; |
|
65 |
} |
|
66 |
|
|
67 |
public static EM_TRACK_OBJECT_TYPE getEnum(int value) { |
|
68 |
for (EM_TRACK_OBJECT_TYPE e : EM_TRACK_OBJECT_TYPE.values()) { |
|
69 |
if (e.getValue() == value){ |
|
70 |
return e; |
|
71 |
} |
|
72 |
} |
|
73 |
return EM_TRACK_OBJECT_TYPE.EM_TRACK_OBJECT_TYPE_UNKNOWN; |
|
74 |
} |
|
75 |
|
|
76 |
} |