NIMSDK-AOS  9.21.0
QChatUpdateServerMemberBanParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.qchat.param;
2 
3 import android.text.TextUtils;
4 
5 public abstract class QChatUpdateServerMemberBanParam {
6 
7  /**
8  * 服务器id
9  */
10  private final long serverId;
11  /**
12  * 目标用户accid
13  */
14  private final String targetAccid;
15  /**
16  * 自定义扩展
17  */
18  private String customExt;
19 
20  /**
21  *
22  * @param serverId 服务器id
23  * @param targetAccid 目标用户accid
24  */
25  public QChatUpdateServerMemberBanParam(long serverId, String targetAccid) {
26  this.serverId = serverId;
27  this.targetAccid = targetAccid;
28  }
29 
30  /**
31  * 获取服务器id
32  * @return
33  */
34  public long getServerId() {
35  return serverId;
36  }
37 
38  /**
39  * 获取目标用户accid
40  * @return
41  */
42  public String getTargetAccid() {
43  return targetAccid;
44  }
45 
46  /**
47  * 获取自定义扩展
48  * @return
49  */
50  public String getCustomExt() {
51  return customExt;
52  }
53 
54  /**
55  * 设置自定义扩展
56  * @param customExt
57  */
58  public void setCustomExt(String customExt) {
59  this.customExt = customExt;
60  }
61 
62  /**
63  * 参数是否合法
64  * @return
65  */
66  public boolean isValid(){
67  if(getServerId() <= 0){
68  return false;
69  }
70  if(TextUtils.isEmpty(getTargetAccid())){
71  return false;
72  }
73  return true;
74  }
75 
76  @Override
77  public String toString() {
78  return "QChatUpdateServerMemberBanParam{" +
79  "serverId=" + serverId +
80  ", targetAccid='" + targetAccid + '\'' +
81  ", customExt='" + customExt + '\'' +
82  '}';
83  }
84 }