NIMSDK-AOS  10.5.0
QChatChannelMuteParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.qchat.param;
2 
3 import com.netease.nimlib.log.NimLog;
6 import java.util.List;
7 
11 public class QChatChannelMuteParam {
12 
13  private static final String TAG = "QChatChannelMuteParam";
14 
18  private long serverId;
19 
23  private long channelId;
24 
28  private QChatMuteOperateType operateType;
29 
33  private List<String> muteAccountIds;
34 
38  private long duration;
39 
43  private String postscript;
44 
48  private QChatMuteNotifyScope notifyType;
49 
50  private QChatChannelMuteParam() {
51  this.serverId = 0;
52  this.channelId = 0;
53  this.operateType = null;
54  this.muteAccountIds = null;
55  this.duration = 0;
56  }
57 
66  public QChatChannelMuteParam(long serverId, long channelId, QChatMuteOperateType operateType, List<String> muteAccountIds, long duration) {
67  this.serverId = serverId;
68  this.channelId = channelId;
69  this.operateType = operateType;
70  this.muteAccountIds = muteAccountIds;
71  this.duration = duration;
72  }
73 
84  public QChatChannelMuteParam(long serverId, long channelId, QChatMuteOperateType operateType, List<String> muteAccountIds, long duration, String postscript, QChatMuteNotifyScope notifyType) {
85  this.serverId = serverId;
86  this.channelId = channelId;
87  this.operateType = operateType;
88  this.muteAccountIds = muteAccountIds;
89  this.duration = duration;
90  this.postscript = postscript;
91  this.notifyType = notifyType;
92  }
93 
99  public long getServerId() {
100  return serverId;
101  }
102 
108  public void setServerId(long serverId) {
109  this.serverId = serverId;
110  }
111 
117  public long getChannelId() {
118  return channelId;
119  }
120 
126  public void setChannelId(long channelId) {
127  this.channelId = channelId;
128  }
129 
136  return operateType;
137  }
138 
144  public void setOperateType(QChatMuteOperateType operateType) {
145  this.operateType = operateType;
146  }
147 
153  public List<String> getMuteAccountIds() {
154  return muteAccountIds;
155  }
156 
162  public void setMuteAccountIds(List<String> muteAccountIds) {
163  this.muteAccountIds = muteAccountIds;
164  }
165 
171  public long getDuration() {
172  return duration;
173  }
174 
180  public void setDuration(long duration) {
181  this.duration = duration;
182  }
183 
189  public String getPostscript() {
190  return postscript;
191  }
192 
198  public void setPostscript(String postscript) {
199  this.postscript = postscript;
200  }
201 
208  return notifyType;
209  }
210 
216  public void setNotifyType(QChatMuteNotifyScope notifyType) {
217  this.notifyType = notifyType;
218  }
219 
224  public boolean isValid() {
225  if(serverId <=0) {
226  NimLog.e(TAG, "serverId is invalid");
227  return false;
228  }
229  if(channelId <= 0) {
230  NimLog.e(TAG, "channelId is invalid");
231  return false;
232  }
233  if(operateType == null) {
234  NimLog.e(TAG, "operateType is invalid");
235  return false;
236  }
237  if(muteAccountIds == null || muteAccountIds.isEmpty()) {
238  NimLog.e(TAG, "muteAccountIds is invalid");
239  return false;
240  }
241  if(duration <= 0) {
242  NimLog.e(TAG, "duration is invalid");
243  return false;
244  }
245  return true;
246  }
247 }
void setDuration(long duration)
设置禁言持续时长
List< String > getMuteAccountIds()
获取禁言成员列表
void setOperateType(QChatMuteOperateType operateType)
设置操作类型
void setMuteAccountIds(List< String > muteAccountIds)
设置禁言成员列表
QChatChannelMuteParam(long serverId, long channelId, QChatMuteOperateType operateType, List< String > muteAccountIds, long duration, String postscript, QChatMuteNotifyScope notifyType)
QChatMuteNotifyScope getNotifyType()
获取通知类型
void setNotifyType(QChatMuteNotifyScope notifyType)
设置通知类型
QChatMuteOperateType getOperateType()
获取操作类型
QChatChannelMuteParam(long serverId, long channelId, QChatMuteOperateType operateType, List< String > muteAccountIds, long duration)