提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* 默认组合通道绑定模式 |
|
5 |
* |
|
6 |
* @author : 47040 |
|
7 |
* @since : Created in 2020/9/27 15:32 |
|
8 |
*/ |
|
9 |
public enum EM_COMPOSIT_CHANNEL_BIND_MODE { |
|
10 |
/** |
|
11 |
* 未知 |
|
12 |
*/ |
|
13 |
EM_COMPOSIT_CHANNEL_BIND_MODE_UNKNOWN(0, "未知"), |
|
14 |
/** |
|
15 |
* 自动 |
|
16 |
*/ |
|
17 |
EM_COMPOSIT_CHANNEL_BIND_MODE_AUTOMATIC(1, "自动"), |
|
18 |
/** |
|
19 |
* 半自动 |
|
20 |
*/ |
|
21 |
EM_COMPOSIT_CHANNEL_BIND_MODE_SEMIAUTOMATIC(2, "半自动"), |
|
22 |
/** |
|
23 |
* 手动 |
|
24 |
*/ |
|
25 |
EM_COMPOSIT_CHANNEL_BIND_MODE_MANUAL(3, "手动"); |
|
26 |
|
|
27 |
private int value; |
|
28 |
private String note; |
|
29 |
|
|
30 |
EM_COMPOSIT_CHANNEL_BIND_MODE(int givenValue, String note) { |
|
31 |
this.value = givenValue; |
|
32 |
this.note = note; |
|
33 |
} |
|
34 |
|
|
35 |
public String getNote() { |
|
36 |
return note; |
|
37 |
} |
|
38 |
|
|
39 |
public int getValue() { |
|
40 |
return value; |
|
41 |
} |
|
42 |
|
|
43 |
public static String getNoteByValue(int givenValue) { |
|
44 |
for (EM_COMPOSIT_CHANNEL_BIND_MODE enumType : EM_COMPOSIT_CHANNEL_BIND_MODE.values()) { |
|
45 |
if (givenValue == enumType.getValue()) { |
|
46 |
return enumType.getNote(); |
|
47 |
} |
|
48 |
} |
|
49 |
return null; |
|
50 |
} |
|
51 |
|
|
52 |
public static int getValueByNote(String givenNote) { |
|
53 |
for (EM_COMPOSIT_CHANNEL_BIND_MODE enumType : EM_COMPOSIT_CHANNEL_BIND_MODE.values()) { |
|
54 |
if (givenNote.equals(enumType.getNote())) { |
|
55 |
return enumType.getValue(); |
|
56 |
} |
|
57 |
} |
|
58 |
return -1; |
|
59 |
} |
|
60 |
|
|
61 |
public static EM_COMPOSIT_CHANNEL_BIND_MODE getEnum(int value) { |
|
62 |
for (EM_COMPOSIT_CHANNEL_BIND_MODE e : EM_COMPOSIT_CHANNEL_BIND_MODE.values()) { |
|
63 |
if (e.getValue() == value) |
|
64 |
return e; |
|
65 |
} |
|
66 |
return EM_COMPOSIT_CHANNEL_BIND_MODE.EM_COMPOSIT_CHANNEL_BIND_MODE_UNKNOWN; |
|
67 |
} |
|
68 |
} |