NIMSDK-AOS  10.5.0
QChatSubscribeServerParam.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;
11 
12 import java.util.ArrayList;
13 import java.util.List;
14 
19 
20  private static final String TAG = "SubscribeServerParam";
24  @NonNull
25  private final QChatSubscribeType type;
29  @NonNull
30  private final QChatSubscribeOperateType operateType;
34  @NonNull
35  private final List<Long> serverIds;
36 
43  public QChatSubscribeServerParam(@NonNull QChatSubscribeType type, @NonNull QChatSubscribeOperateType operateType, @NonNull List<Long> serverIds) {
44  if (!QChatSubscribeType.isIllegalServerSubType(type.getValue())) {
45  String error = String.format("QChatSubType(%s) is Illegal", type);
46  if (BuildConfig.DEBUG) {
47  throw new IllegalArgumentException(error);
48  } else if (LogDesensitizationConfigHelper.printToLogcat()) {
49  Log.e(TAG, error);
50  }
51  }
52 
53  this.type = type;
54  this.operateType = operateType;
55  this.serverIds = new ArrayList<>(serverIds);
56  }
57 
61  @NonNull
63  return type;
64  }
65 
69  @NonNull
71  return operateType;
72  }
73 
77  @NonNull
78  public List<Long> getServerIds() {
79  return serverIds;
80  }
81 }
List< Long > getServerIds()
获取操作的对象:serverId列表
QChatSubscribeServerParam(@NonNull QChatSubscribeType type, @NonNull QChatSubscribeOperateType operateType, @NonNull List< Long > serverIds)
QChatSubscribeOperateType getOperateType()
获取操作类型