NIMSDK-AOS  10.5.0
QChatServerMuteParam.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 QChatServerMuteParam {
12 
13  private static final String TAG = "QChatServerMuteParam";
14 
18  private final long serverId;
19 
23  private final QChatMuteOperateType operateType;
24 
28  private final List<String> muteAccountIds;
29 
33  private final long duration;
34 
38  private String postscript;
39 
43  private QChatMuteNotifyScope notifyType;
44 
45  private QChatServerMuteParam() {
46  this.serverId = 0;
47  this.operateType = null;
48  this.muteAccountIds = null;
49  this.duration = 0;
50  }
51 
59  public QChatServerMuteParam(long serverId, QChatMuteOperateType operateType, List<String> muteAccountIds, long duration) {
60  this.serverId = serverId;
61  this.operateType = operateType;
62  this.muteAccountIds = muteAccountIds;
63  this.duration = duration;
64  }
74  public QChatServerMuteParam(long serverId, QChatMuteOperateType operateType, List<String> muteAccountIds, long duration, String postscript,
75  QChatMuteNotifyScope notifyType) {
76  this.serverId = serverId;
77  this.operateType = operateType;
78  this.muteAccountIds = muteAccountIds;
79  this.duration = duration;
80  this.postscript = postscript;
81  this.notifyType = notifyType;
82  }
83 
89  public long getServerId() {
90  return serverId;
91  }
92 
99  return operateType;
100  }
101 
102 
108  public List<String> getMuteAccountIds() {
109  return muteAccountIds;
110  }
111 
112 
118  public long getDuration() {
119  return duration;
120  }
121 
127  public String getPostscript() {
128  return postscript;
129  }
130 
136  public void setPostscript(String postscript) {
137  this.postscript = postscript;
138  }
139 
146  return notifyType;
147  }
148 
154  public void setNotifyType(QChatMuteNotifyScope notifyType) {
155  this.notifyType = notifyType;
156  }
157 
162  public boolean isValid() {
163  if(serverId <=0) {
164  NimLog.e(TAG, "serverId is invalid");
165  return false;
166  }
167  if(operateType == null) {
168  NimLog.e(TAG, "operateType is invalid");
169  return false;
170  }
171  if(muteAccountIds == null || muteAccountIds.isEmpty()) {
172  NimLog.e(TAG, "muteAccountIds is invalid");
173  return false;
174  }
175  if(duration <= 0) {
176  NimLog.e(TAG, "duration is invalid");
177  return false;
178  }
179  return true;
180  }
181 }
QChatMuteOperateType getOperateType()
获取操作类型
QChatMuteNotifyScope getNotifyType()
获取通知类型
QChatServerMuteParam(long serverId, QChatMuteOperateType operateType, List< String > muteAccountIds, long duration, String postscript, QChatMuteNotifyScope notifyType)
List< String > getMuteAccountIds()
获取禁言成员列表
void setNotifyType(QChatMuteNotifyScope notifyType)
设置通知类型
QChatServerMuteParam(long serverId, QChatMuteOperateType operateType, List< String > muteAccountIds, long duration)