NIMSDK-AOS  9.16.0
QChatCreateChannelParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.qchat.param;
2 
3 import androidx.annotation.NonNull;
4 import com.netease.nimlib.BuildConfig;
5 import com.netease.nimlib.log.NimLog;
10 
14 public class QChatCreateChannelParam extends QChatAntiSpamConfigParam{
15 
16  private static final String TAG = "QChatCreateChannelParam";
20  @NonNull
21  private final Long serverId;
25  @NonNull
26  private final String name;
30  @NonNull
31  private final Integer type;
35  private String topic;
39  private String custom;
40 
44  private QChatChannelMode viewMode;
45 
49  private Long categoryId;
53  private QChatChannelSyncMode syncMode;
54 
58  private QChatVisitorMode visitorMode;
59 
66  @SuppressWarnings("java:S2259")
67  public QChatCreateChannelParam(long serverId, @NonNull String name, @NonNull QChatChannelType type) {
68  if (type == null) {
69  String error = String.format("QChatCreateChannelParam QChatChannelType is %s", type);
70  if (BuildConfig.DEBUG) {
71  throw new IllegalArgumentException(error);
72  } else {
73  NimLog.e(TAG, error);
74  }
75  }
76 
77  this.serverId = serverId;
78  this.name = name;
79  this.type = type.getValue();
80  }
81 
88  private QChatCreateChannelParam(long serverId, @NonNull String name, int customType) {
89  this.serverId = serverId;
90  this.name = name;
91  this.type = customType;
92  }
93 
98  public void setTopic(String topic) {
99  this.topic = topic;
100  }
101 
106  public void setCustom(String custom) {
107  this.custom = custom;
108  }
109 
114  @NonNull
115  public Long getServerId() {
116  return serverId;
117  }
118 
123  @NonNull
124  public String getName() {
125  return name;
126  }
127 
132  public String getTopic() {
133  return topic;
134  }
135 
140  public String getCustom() {
141  return custom;
142  }
143 
148  @NonNull
149  public Integer getType() {
150  return type;
151  }
152 
158  return viewMode;
159  }
160 
165  public void setViewMode(QChatChannelMode viewMode) {
166  this.viewMode = viewMode;
167  }
168 
173  public Long getCategoryId() {
174  return categoryId;
175  }
176 
181  public void setCategoryId(Long categoryId) {
182  this.categoryId = categoryId;
183  }
184 
190  return syncMode;
191  }
192 
197  public void setSyncMode(QChatChannelSyncMode syncMode) {
198  this.syncMode = syncMode;
199  }
200 
206  return visitorMode;
207  }
208 
213  public void setVisitorMode(QChatVisitorMode visitorMode) {
214  this.visitorMode = visitorMode;
215  }
216 
217 }
void setSyncMode(QChatChannelSyncMode syncMode)
设置同步模式
QChatCreateChannelParam(long serverId, @NonNull String name, @NonNull QChatChannelType type)
void setVisitorMode(QChatVisitorMode visitorMode)
设置游客可见模式
void setViewMode(QChatChannelMode viewMode)
设置频道查看模式
QChatVisitorMode getVisitorMode()
获取游客可见模式