NIMSDK-AOS  10.6.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;
8 import com.netease.nimlib.log.model.LogDesensitizationConfigHelper;
12 
13 import java.util.ArrayList;
14 import java.util.List;
15 
20 
21  private static final String TAG = "SubscribeChannelParam";
25  @NonNull
26  private final QChatSubscribeType type;
30  @NonNull
31  private final QChatSubscribeOperateType operateType;
35  @NonNull
36  private final List<QChatChannelIdInfo> channelIdInfos;
37 
44  public QChatSubscribeChannelParam(@NonNull QChatSubscribeType type, @NonNull QChatSubscribeOperateType operateType, @NonNull List<QChatChannelIdInfo> channelIdInfos) {
45  if (!QChatSubscribeType.isIllegalChannelSubType(type.getValue())) {
46  String error = String.format("QChatSubType(%s) is Illegal", type);
47  if (BuildConfig.DEBUG) {
48  throw new IllegalArgumentException(error);
49  } else if (LogDesensitizationConfigHelper.printToLogcat()) {
50  Log.e(TAG, error);
51  }
52  }
53 
54  this.type = type;
55  this.operateType = operateType;
56  this.channelIdInfos = new ArrayList<>(channelIdInfos);
57  }
58 
62  @NonNull
64  return type;
65  }
66 
70  @NonNull
72  return operateType;
73  }
74 
78  @NonNull
79  public List<QChatChannelIdInfo> getChannelIdInfos() {
80  return channelIdInfos;
81  }
82 }
List< QChatChannelIdInfo > getChannelIdInfos()
获取操作的对象:channelInfo列表
QChatSubscribeChannelParam(@NonNull QChatSubscribeType type, @NonNull QChatSubscribeOperateType operateType, @NonNull List< QChatChannelIdInfo > channelIdInfos)