NIMSDK-AOS  9.16.0
QChatSubscribeChannelParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.qchat.param;
2 
3 import android.util.Log;
4 
5 import androidx.annotation.NonNull;
6 
7 import com.netease.nimlib.BuildConfig;
11 
12 import java.util.ArrayList;
13 import java.util.List;
14 
19 
20  private static final String TAG = "SubscribeChannelParam";
24  @NonNull
25  private final QChatSubscribeType type;
29  @NonNull
30  private final QChatSubscribeOperateType operateType;
34  @NonNull
35  private final List<QChatChannelIdInfo> channelIdInfos;
36 
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 
61  @NonNull
63  return type;
64  }
65 
69  @NonNull
71  return operateType;
72  }
73 
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)