提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
/** |
|
3 |
* @author 251823 |
|
4 |
* @description 动作类型 |
|
5 |
* @date 2022/03/31 |
|
6 |
*/ |
|
7 |
public enum EM_STEREO_ACTION_TYPE { |
|
8 |
// 未知 |
|
9 |
EM_STEREO_ACTION_TYPE_UNKNOWN(0, "未知"), |
|
10 |
|
|
11 |
// 剧烈运动 |
|
12 |
EM_STEREO_ACTION_TYPE_DRASTIC_MOTION(1, "剧烈运动"), |
|
13 |
|
|
14 |
// 单人打砸 |
|
15 |
EM_STEREO_ACTION_TYPE_SINGLE_FIGHT(2, "单人打砸"), |
|
16 |
|
|
17 |
// 多人打架 |
|
18 |
EM_STEREO_ACTION_TYPE_MULTI_FIGHT(3, "多人打架"); |
|
19 |
|
|
20 |
private int value; |
|
21 |
private String note; |
|
22 |
|
|
23 |
private EM_STEREO_ACTION_TYPE(int givenValue, String note) { |
|
24 |
this.value = givenValue; |
|
25 |
this.note = note; |
|
26 |
} |
|
27 |
|
|
28 |
public String getNote() { |
|
29 |
return note; |
|
30 |
} |
|
31 |
|
|
32 |
public int getValue() { |
|
33 |
return value; |
|
34 |
} |
|
35 |
|
|
36 |
public static String getNoteByValue(int givenValue) { |
|
37 |
for (EM_STEREO_ACTION_TYPE enumType : EM_STEREO_ACTION_TYPE.values()) { |
|
38 |
if (givenValue == enumType.getValue()) { |
|
39 |
return enumType.getNote(); |
|
40 |
} |
|
41 |
} |
|
42 |
return null; |
|
43 |
} |
|
44 |
|
|
45 |
public static int getValueByNote(String givenNote) { |
|
46 |
for (EM_STEREO_ACTION_TYPE enumType : EM_STEREO_ACTION_TYPE.values()) { |
|
47 |
if (givenNote.equals(enumType.getNote())) { |
|
48 |
return enumType.getValue(); |
|
49 |
} |
|
50 |
} |
|
51 |
return -1; |
|
52 |
} |
|
53 |
} |