提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 事件类型描述 |
|
6 |
* @date 2022/08/18 10:00:46 |
|
7 |
*/ |
|
8 |
public enum EM_EVENT_TYPE_DESCEIBEINFO { |
|
9 |
/** |
|
10 |
* 正常抓图事件 |
|
11 |
*/ |
|
12 |
EM_EVENT_NORMAL(0, "正常抓图事件"), |
|
13 |
/** |
|
14 |
* 邮件联动抓图事件 |
|
15 |
*/ |
|
16 |
EM_EVENT_EMAIL(1, "邮件联动抓图事件"); |
|
17 |
|
|
18 |
private int value; |
|
19 |
|
|
20 |
private String note; |
|
21 |
|
|
22 |
public String getNote() { |
|
23 |
return note; |
|
24 |
} |
|
25 |
|
|
26 |
public int getValue() { |
|
27 |
return value; |
|
28 |
} |
|
29 |
|
|
30 |
EM_EVENT_TYPE_DESCEIBEINFO(int givenValue, String note) { |
|
31 |
this.value = givenValue; |
|
32 |
this.note = note; |
|
33 |
} |
|
34 |
|
|
35 |
public static String getNoteByValue(int givenValue) { |
|
36 |
for (EM_EVENT_TYPE_DESCEIBEINFO enumType : EM_EVENT_TYPE_DESCEIBEINFO.values()) { |
|
37 |
if (givenValue == enumType.getValue()) { |
|
38 |
return enumType.getNote(); |
|
39 |
} |
|
40 |
} |
|
41 |
return null; |
|
42 |
} |
|
43 |
|
|
44 |
public static int getValueByNote(String givenNote) { |
|
45 |
for (EM_EVENT_TYPE_DESCEIBEINFO enumType : EM_EVENT_TYPE_DESCEIBEINFO.values()) { |
|
46 |
if (givenNote.equals(enumType.getNote())) { |
|
47 |
return enumType.getValue(); |
|
48 |
} |
|
49 |
} |
|
50 |
return -1; |
|
51 |
} |
|
52 |
} |