NIMSDK-AOS  9.16.0
QChatSearchServerMemberByPageParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.qchat.param;
2 
3 import androidx.annotation.NonNull;
4 import androidx.annotation.Nullable;
5 import com.netease.nimlib.util.StringUtil;
6 
14  @NonNull
15  private final String keyword;
16 
20  private final long serverId;
21 
25  @Nullable
26  private Integer limit;
27 
34  public QChatSearchServerMemberByPageParam(@NonNull String keyword, long serverId) {
35  this(keyword, serverId, null);
36  }
37 
45  public QChatSearchServerMemberByPageParam(@NonNull String keyword, long serverId, @Nullable Integer limit) {
46  this.keyword = keyword;
47  this.serverId = serverId;
48  this.limit = limit;
49  }
50 
54  public String getKeyword() {
55  return keyword;
56  }
57 
61  public long getServerId() {
62  return serverId;
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 (limit != null && limit < 0) {
91  return false;
92  }
93  return true;
94  }
95 
96  @Override
97  public String toString() {
98  return "QChatSearchServerMemberByPageParam{" +
99  "keyword='" + keyword + '\'' +
100  ", serverId=" + serverId +
101  ", limit=" + limit +
102  '}';
103  }
104 }
QChatSearchServerMemberByPageParam(@NonNull String keyword, long serverId)
构造函数
void setLimit(@Nullable Integer limit)
设置检索返回的最大记录数
QChatSearchServerMemberByPageParam(@NonNull String keyword, long serverId, @Nullable Integer limit)
构造函数