NIMSDK-AOS  9.19.0
QChatSearchMsgByPageParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.qchat.param;
2 
3 import androidx.annotation.NonNull;
6 import java.util.List;
7 
8 /**
9  * 检索消息的接口入参
10  */
12 
13  /**
14  * 检索关键字,目标检索消息名称
15  */
16  private String keyword;
17  /**
18  * 服务器ID
19  */
20  private final long serverId;
21 
22  /**
23  * 频道ID
24  */
25  private Long channelId;
26 
27  /**
28  * 消息发送者accid
29  */
30  private String fromAccount;
31 
32  /**
33  * 查询时间范围的开始时间
34  */
35  private Long fromTime;
36 
37  /**
38  * 查询时间范围的结束时间,要求比开始时间大
39  */
40  private Long toTime;
41 
42  /**
43  * 搜索的消息类型列表,目前仅支持{@link MsgTypeEnum#text,MsgTypeEnum#image,MsgTypeEnum#video,MsgTypeEnum#file}
44  */
45  @NonNull
46  private final List<MsgTypeEnum> msgTypes;
47  /**
48  * 搜索的消息子类型列表
49  */
50  private List<Integer> subTypes;
51  /**
52  * 是否包含自己的消息
53  */
54  private Boolean isIncludeSelf;
55 
56  /**
57  * 排序规则 true:正序;false:倒序(默认)
58  */
59  private Boolean order;
60  /**
61  * 检索返回的最大记录数,最大和默认都是100
62  */
63  private Integer limit;
64  /**
65  * 排序条件
66  */
67  private QChatMessageSearchSortEnum sort;
68 
69  /**
70  * 查询游标,下次查询的起始位置,第一页设置为null,查询下一页是传入上一页返回的cursor
71  */
72  private String cursor;
73 
74 
75  /**
76  *
77  * @param serverId 服务器ID
78  * @param msgTypes 搜索的消息类型列表
79  */
80  public QChatSearchMsgByPageParam(long serverId, @NonNull List<MsgTypeEnum> msgTypes) {
81  this.serverId = serverId;
82  this.msgTypes = msgTypes;
83  }
84 
85  /**
86  *
87  * @param keyword 检索关键字
88  * @param serverId 服务器Id
89  * @param channelId 频道Id
90  * @param fromAccount 消息发送者accid
91  * @param fromTime 查询开始时间
92  * @param toTime 查询结束时间
93  * @param msgTypes 搜索的消息类型列表
94  * @param subTypes 搜索的消息子类型列表
95  * @param isIncludeSelf 是否包含自己发送的消息
96  * @param order 排序规则 true:正序;false:倒序(默认)
97  * @param limit 检索返回的最大记录数,最大和默认都是100
98  * @param sort 排序条件
99  * @param cursor 查询游标,下次查询的起始位置,第一页设置为null,查询下一页是传入上一页返回的cursor
100  */
101  public QChatSearchMsgByPageParam(String keyword, long serverId, Long channelId, String fromAccount, Long fromTime, Long toTime,
102  @NonNull List<MsgTypeEnum> msgTypes, List<Integer> subTypes, Boolean isIncludeSelf, Boolean order, Integer limit,
103  QChatMessageSearchSortEnum sort, String cursor) {
104  this.keyword = keyword;
105  this.serverId = serverId;
106  this.channelId = channelId;
107  this.fromAccount = fromAccount;
108  this.fromTime = fromTime;
109  this.toTime = toTime;
110  this.msgTypes = msgTypes;
111  this.subTypes = subTypes;
112  this.isIncludeSelf = isIncludeSelf;
113  this.order = order;
114  this.limit = limit;
115  this.sort = sort;
116  this.cursor = cursor;
117  }
118 
119  /**
120  * 获取检索关键字
121  * @return
122  */
123  public String getKeyword() {
124  return keyword;
125  }
126 
127  /**
128  * 设置检索关键字
129  * @param keyword
130  */
131  public void setKeyword(String keyword) {
132  this.keyword = keyword;
133  }
134 
135  /**
136  * 获取服务器Id
137  * @return
138  */
139  public long getServerId() {
140  return serverId;
141  }
142 
143  /**
144  * 获取频道Id
145  * @return
146  */
147  public Long getChannelId() {
148  return channelId;
149  }
150 
151  /**
152  * 设置频道Id
153  * @param channelId
154  */
155  public void setChannelId(Long channelId) {
156  this.channelId = channelId;
157  }
158 
159  /**
160  * 获取消息发送者accid
161  * @return
162  */
163  public String getFromAccount() {
164  return fromAccount;
165  }
166 
167  /**
168  * 设置消息发送者accid
169  * @param fromAccount
170  */
171  public void setFromAccount(String fromAccount) {
172  this.fromAccount = fromAccount;
173  }
174 
175  /**
176  * 获取查询开始时间
177  * @return
178  */
179  public Long getFromTime() {
180  return fromTime;
181  }
182 
183  /**
184  * 设置查询开始时间
185  * @param fromTime
186  */
187  public void setFromTime(Long fromTime) {
188  this.fromTime = fromTime;
189  }
190 
191  /**
192  * 获取查询结束时间
193  * @return
194  */
195  public Long getToTime() {
196  return toTime;
197  }
198 
199  /**
200  * 设置查询结束时间
201  * @param toTime
202  */
203  public void setToTime(Long toTime) {
204  this.toTime = toTime;
205  }
206 
207  /**
208  *
209  * 获取搜索的消息类型列表
210  * @return
211  */
212  @NonNull
213  public List<MsgTypeEnum> getMsgTypes() {
214  return msgTypes;
215  }
216 
217  /**
218  * 获取搜索的消息子类型列表
219  * @return
220  */
221  public List<Integer> getSubTypes() {
222  return subTypes;
223  }
224 
225  /**
226  * 设置搜索的消息子类型列表
227  * @param subTypes
228  */
229  public void setSubTypes(List<Integer> subTypes) {
230  this.subTypes = subTypes;
231  }
232 
233  /**
234  * 获取是否包含自己发送的消息
235  * @return
236  */
237  public Boolean isIncludeSelf() {
238  return isIncludeSelf;
239  }
240 
241  /**
242  * 设置是否包含自己发送的消息
243  * @param includeSelf
244  */
245  public void setIncludeSelf(Boolean includeSelf) {
246  isIncludeSelf = includeSelf;
247  }
248 
249  /**
250  * 获取排序规则 true:正序;false:倒序(默认)
251  * @return
252  */
253  public Boolean getOrder() {
254  return order;
255  }
256 
257  /**
258  * 设置排序规则 true:正序;false:倒序(默认)
259  * @param order
260  */
261  public void setOrder(Boolean order) {
262  this.order = order;
263  }
264 
265  /**
266  * 获取检索返回的最大记录数,最大和默认都是100
267  * @return
268  */
269  public Integer getLimit() {
270  return limit;
271  }
272 
273  /**
274  * 设置检索返回的最大记录数,最大和默认都是100
275  * @param limit
276  */
277  public void setLimit(Integer limit) {
278  this.limit = limit;
279  }
280 
281  /**
282  * 获取排序条件
283  * @return
284  */
286  return sort;
287  }
288 
289  /**
290  * 设置排序条件
291  * @param sort
292  */
294  this.sort = sort;
295  }
296 
297  /**
298  * 获取查询游标,下次查询的起始位置,第一页设置为null,查询下一页是传入上一页返回的cursor
299  * @return
300  */
301  public String getCursor() {
302  return cursor;
303  }
304 
305  /**
306  * 设置查询游标,下次查询的起始位置,第一页设置为null,查询下一页是传入上一页返回的cursor
307  * @param cursor
308  */
309  public void setCursor(String cursor) {
310  this.cursor = cursor;
311  }
312 }
void setLimit(Integer limit)
设置检索返回的最大记录数,最大和默认都是100
QChatSearchMsgByPageParam(long serverId, @NonNull List< MsgTypeEnum > msgTypes)
String getCursor()
获取查询游标,下次查询的起始位置,第一页设置为null,查询下一页是传入上一页返回的cursor ...
void setSubTypes(List< Integer > subTypes)
设置搜索的消息子类型列表
Boolean isIncludeSelf()
获取是否包含自己发送的消息
void setIncludeSelf(Boolean includeSelf)
设置是否包含自己发送的消息
List< MsgTypeEnum > getMsgTypes()
获取搜索的消息类型列表
void setFromAccount(String fromAccount)
设置消息发送者accid
void setSort(QChatMessageSearchSortEnum sort)
设置排序条件
Boolean getOrder()
获取排序规则 true:正序;false:倒序(默认)
Integer getLimit()
获取检索返回的最大记录数,最大和默认都是100
void setCursor(String cursor)
设置查询游标,下次查询的起始位置,第一页设置为null,查询下一页是传入上一页返回的cursor ...
void setOrder(Boolean order)
设置排序规则 true:正序;false:倒序(默认)
List< Integer > getSubTypes()
获取搜索的消息子类型列表
QChatSearchMsgByPageParam(String keyword, long serverId, Long channelId, String fromAccount, Long fromTime, Long toTime, @NonNull List< MsgTypeEnum > msgTypes, List< Integer > subTypes, Boolean isIncludeSelf, Boolean order, Integer limit, QChatMessageSearchSortEnum sort, String cursor)