NIMSDK-AOS  9.16.0
QChatSearchChannelMembersParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.qchat.param;
2 
3 import androidx.annotation.NonNull;
4 import androidx.annotation.Nullable;
5 
6 import com.netease.nimlib.util.StringUtil;
7 
12  private final long serverId;
13 
17  private final long channelId;
18 
22  @NonNull
23  private final String keyword;
24 
28  @Nullable
29  private Integer limit;
30 
38  public QChatSearchChannelMembersParam(long serverId, long channelId, @NonNull String keyword) {
39  this.serverId = serverId;
40  this.channelId = channelId;
41  this.keyword = keyword;
42  }
43 
47  public long getServerId() {
48  return serverId;
49  }
50 
54  public long getChannelId() {
55  return channelId;
56  }
57 
61  public String getKeyword() {
62  return keyword;
63  }
64 
68  @Nullable
69  public Integer getLimit() {
70  return limit;
71  }
72 
76  public void setLimit(@Nullable Integer limit) {
77  this.limit = limit;
78  }
79 
83  public boolean isValid() {
84  if (StringUtil.isEmpty(keyword)) {
85  return false;
86  }
87  if (serverId <= 0) {
88  return false;
89  }
90  if (channelId <= 0) {
91  return false;
92  }
93  if (limit != null && limit < 0) {
94  return false;
95  }
96  return true;
97  }
98 
99  @Override
100  public String toString() {
101  return "QChatSearchChannelMembersParam{" +
102  "serverId=" + serverId +
103  ", channelId=" + channelId +
104  ", keyword='" + keyword + '\'' +
105  ", limit=" + limit +
106  '}';
107  }
108 }
QChatSearchChannelMembersParam(long serverId, long channelId, @NonNull String keyword)
构造函数
void setLimit(@Nullable Integer limit)
设置检索返回的最大记录数