提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
import com.iailab.netsdk.lib.NetSDKLib; |
|
4 |
import com.iailab.netsdk.lib.structure.*; |
|
5 |
|
|
6 |
/** |
|
7 |
* {@link NetSDKLib#CLIENT_OperateCourseCompositeChannelMode} |
|
8 |
* @author : 47040 |
|
9 |
* @since : Created in 2020/9/27 16:30 |
|
10 |
*/ |
|
11 |
public enum NET_COURSECOMPOSITE_MODE_OPERATE_TYPE { |
|
12 |
/** |
|
13 |
* 添加模式,对应结构体 |
|
14 |
* pInParam {@link NET_IN_COURSECOMPOSITE_CHANNEL_MODE_ADD} |
|
15 |
* pOutParam {@link NET_OUT_COURSECOMPOSITE_CHANNEL_MODE_ADD} |
|
16 |
*/ |
|
17 |
NET_COURSECOMPOSITE_MODE_ADD(0, "添加模式"), |
|
18 |
/** |
|
19 |
* 删除模式,对应结构体 |
|
20 |
* pInParam {@link NET_IN_COURSECOMPOSITE_CHANNEL_MODE_DELETE} |
|
21 |
* pOutParam {@link NET_OUT_COURSECOMPOSITE_CHANNEL_MODE_DELETE} |
|
22 |
*/ |
|
23 |
NET_COURSECOMPOSITE_MODE_DELETE(1, "删除模式"), |
|
24 |
/** |
|
25 |
* 修改模式,对应结构体 |
|
26 |
* pInParam {@link NET_IN_COURSECOMPOSITE_CHANNEL_MODE_MODIFY} |
|
27 |
* pOutParam {@link NET_OUT_COURSECOMPOSITE_CHANNEL_MODE_MODIFY} |
|
28 |
*/ |
|
29 |
NET_COURSECOMPOSITE_MODE_MODIFY(2, "修改模式"), |
|
30 |
/** |
|
31 |
* 获取模式,对应结构体 |
|
32 |
* pInParam {@link NET_IN_COURSECOMPOSITE_CHANNEL_MODE_GET} |
|
33 |
* pOutParam {@link NET_OUT_COURSECOMPOSITE_CHANNEL_MODE_GET} |
|
34 |
*/ |
|
35 |
NET_COURSECOMPOSITE_MODE_GET(3, "获取模式"); |
|
36 |
|
|
37 |
|
|
38 |
private int value; |
|
39 |
private String note; |
|
40 |
|
|
41 |
NET_COURSECOMPOSITE_MODE_OPERATE_TYPE(int givenValue, String note) { |
|
42 |
this.value = givenValue; |
|
43 |
this.note = note; |
|
44 |
} |
|
45 |
|
|
46 |
public String getNote() { |
|
47 |
return note; |
|
48 |
} |
|
49 |
|
|
50 |
public int getValue() { |
|
51 |
return value; |
|
52 |
} |
|
53 |
|
|
54 |
public static String getNoteByValue(int givenValue) { |
|
55 |
for (NET_COURSECOMPOSITE_MODE_OPERATE_TYPE enumType : NET_COURSECOMPOSITE_MODE_OPERATE_TYPE.values()) { |
|
56 |
if (givenValue == enumType.getValue()) { |
|
57 |
return enumType.getNote(); |
|
58 |
} |
|
59 |
} |
|
60 |
return null; |
|
61 |
} |
|
62 |
|
|
63 |
public static int getValueByNote(String givenNote) { |
|
64 |
for (NET_COURSECOMPOSITE_MODE_OPERATE_TYPE enumType : NET_COURSECOMPOSITE_MODE_OPERATE_TYPE.values()) { |
|
65 |
if (givenNote.equals(enumType.getNote())) { |
|
66 |
return enumType.getValue(); |
|
67 |
} |
|
68 |
} |
|
69 |
return -1; |
|
70 |
} |
|
71 |
|
|
72 |
public static NET_COURSECOMPOSITE_MODE_OPERATE_TYPE getEnum(int value) { |
|
73 |
for (NET_COURSECOMPOSITE_MODE_OPERATE_TYPE e : NET_COURSECOMPOSITE_MODE_OPERATE_TYPE.values()) { |
|
74 |
if (e.getValue() == value) |
|
75 |
return e; |
|
76 |
} |
|
77 |
return NET_COURSECOMPOSITE_MODE_OPERATE_TYPE.NET_COURSECOMPOSITE_MODE_GET; |
|
78 |
} |
|
79 |
} |