NIMSDK-AOS 10.4.0-beta
载入中...
搜索中...
未找到
QChatSubscribeChannelParam.java
浏览该文件的文档.
1package com.netease.nimlib.sdk.qchat.param;
2
3import android.util.Log;
4
5import androidx.annotation.NonNull;
6
7import com.netease.nimlib.BuildConfig;
8import com.netease.nimlib.sdk.qchat.enums.QChatSubscribeOperateType;
9import com.netease.nimlib.sdk.qchat.enums.QChatSubscribeType;
10import com.netease.nimlib.sdk.qchat.model.QChatChannelIdInfo;
11
12import java.util.ArrayList;
13import java.util.List;
14
15/**
16 * "订阅频道"接口入参
17 */
19
20 private static final String TAG = "SubscribeChannelParam";
21 /**
22 * 请求参数,订阅类型,见QChatSubType
23 */
24 @NonNull
25 private final QChatSubscribeType type;
26 /**
27 * 请求参数,操作类型,见QChatSubOperateType
28 */
29 @NonNull
30 private final QChatSubscribeOperateType operateType;
31 /**
32 * 请求参数,操作的对象:channelInfo列表
33 */
34 @NonNull
35 private final List<QChatChannelIdInfo> channelIdInfos;
36
37 /**
38 *
39 * @param type 订阅类型
40 * @param operateType 操作类型
41 * @param channelIdInfos 操作的对象, channelInfo列表
42 */
43 public QChatSubscribeChannelParam(@NonNull QChatSubscribeType type, @NonNull QChatSubscribeOperateType operateType, @NonNull List<QChatChannelIdInfo> channelIdInfos) {
44 if (!QChatSubscribeType.isIllegalChannelSubType(type.getValue())) {
45 String error = String.format("QChatSubType(%s) is Illegal", type);
46 if (BuildConfig.DEBUG) {
47 throw new IllegalArgumentException(error);
48 } else {
49 Log.e(TAG, error);
50 }
51 }
52
53 this.type = type;
54 this.operateType = operateType;
55 this.channelIdInfos = new ArrayList<>(channelIdInfos);
56 }
57
58 /**
59 * 获取订阅类型
60 */
61 @NonNull
63 return type;
64 }
65
66 /**
67 * 获取操作类型
68 */
69 @NonNull
71 return operateType;
72 }
73
74 /**
75 * 获取操作的对象:channelInfo列表
76 */
77 @NonNull
78 public List<QChatChannelIdInfo> getChannelIdInfos() {
79 return channelIdInfos;
80 }
81}
List< QChatChannelIdInfo > getChannelIdInfos()
获取操作的对象:channelInfo列表
QChatSubscribeChannelParam(@NonNull QChatSubscribeType type, @NonNull QChatSubscribeOperateType operateType, @NonNull List< QChatChannelIdInfo > channelIdInfos)