提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author : 47040 |
|
5 |
* @since : Created in 2020/8/19 10:21 |
|
6 |
*/ |
|
7 |
public enum EM_TRIGGER_TYPE { |
|
8 |
/** |
|
9 |
* 未知类型 |
|
10 |
*/ |
|
11 |
EM_TRIGGER_TYPE_UNKNOWN(-1,"未知类型"), |
|
12 |
/** |
|
13 |
* 车检器 |
|
14 |
*/ |
|
15 |
EM_TRIGGER_TYPE_CAR_INSPECTION_DEV(0,"车检器"), // 车检器 |
|
16 |
/** |
|
17 |
* 雷达 |
|
18 |
*/ |
|
19 |
EM_TRIGGER_TYPE_DADAR(1,"雷达"), |
|
20 |
/** |
|
21 |
* 视频 |
|
22 |
*/ |
|
23 |
EM_TRIGGER_TYPE_VIDEO(2,"视频"); |
|
24 |
|
|
25 |
private int value; |
|
26 |
private String note; |
|
27 |
|
|
28 |
private EM_TRIGGER_TYPE(int givenValue, String note) { |
|
29 |
this.value = givenValue; |
|
30 |
this.note = note; |
|
31 |
} |
|
32 |
|
|
33 |
public String getNote() { |
|
34 |
return note; |
|
35 |
} |
|
36 |
|
|
37 |
public int getValue() { |
|
38 |
return value; |
|
39 |
} |
|
40 |
|
|
41 |
public static String getNoteByValue(int givenValue) { |
|
42 |
for (EM_TRIGGER_TYPE enumType : EM_TRIGGER_TYPE.values()) { |
|
43 |
if (givenValue == enumType.getValue()) { |
|
44 |
return enumType.getNote(); |
|
45 |
} |
|
46 |
} |
|
47 |
return null; |
|
48 |
} |
|
49 |
|
|
50 |
public static int getValueByNote(String givenNote) { |
|
51 |
for (EM_TRIGGER_TYPE enumType : EM_TRIGGER_TYPE.values()) { |
|
52 |
if (givenNote.equals(enumType.getNote()) ) { |
|
53 |
return enumType.getValue(); |
|
54 |
} |
|
55 |
} |
|
56 |
return -1; |
|
57 |
} |
|
58 |
} |