NIMSDK-AOS  9.19.0
MsgSearchOption.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.msg.model;
2 
4 
5 import java.util.List;
6 
7 /**
8  * 消息搜索选项
9  */
10 public class MsgSearchOption {
11  /**
12  * 一次查询的最多条数
13  */
14  private static final int DEFAULT_LIMIT = 100;
15  /**
16  * 起始时间点单位毫秒
17  */
18  private long startTime = 0;
19  /**
20  * 结束时间点单位毫秒
21  */
22  private long endTime = 0;
23  /**
24  * 本次查询的消息条数上限(默认100条)
25  */
26  private int limit = DEFAULT_LIMIT;
27  /**
28  * 检索方向
29  */
30  private SearchOrderEnum order = SearchOrderEnum.DESC;
31  /**
32  * 消息类型组合
33  */
34  private List<MsgTypeEnum> messageTypes = null;
35  /**
36  * 消息子类型组合
37  */
38  private List<Integer> messageSubTypes = null;
39  /**
40  * 是否搜索全部消息类型
41  */
42  private boolean allMessageTypes = false;
43  /**
44  * 搜索文本内容
45  */
46  private String searchContent = null;
47  /**
48  * 消息说话者帐号列表
49  */
50  private List<String> fromIds;
51  /**
52  * 将搜索文本中的正则特殊字符转义,默认 true
53  */
54  private boolean enableContentTransfer = true;
55 
56  public MsgSearchOption() {
57 
58  }
59 
61  this.startTime = option.getStartTime();
62  this.endTime = option.getEndTime();
63  this.limit = option.getLimit();
64  this.order = option.getOrder();
65  this.messageTypes = option.getMessageTypes();
66  this.messageSubTypes = option.getMessageSubTypes();
67  this.allMessageTypes = option.isAllMessageTypes();
68  this.searchContent = option.getSearchContent();
69  this.fromIds = option.getFromIds();
70  this.enableContentTransfer = option.isEnableContentTransfer();
71  }
72 
73  public long getStartTime() {
74  return startTime;
75  }
76 
77  public void setStartTime(long startTime) {
78  this.startTime = startTime;
79  }
80 
81  public long getEndTime() {
82  return endTime;
83  }
84 
85  public void setEndTime(long endTime) {
86  this.endTime = endTime;
87  }
88 
89  public int getLimit() {
90  return limit;
91  }
92 
93  public void setLimit(int limit) {
94  this.limit = limit;
95  }
96 
98  return order;
99  }
100 
101  public void setOrder(SearchOrderEnum order) {
102  this.order = order;
103  }
104 
105  public List<MsgTypeEnum> getMessageTypes() {
106  return messageTypes;
107  }
108 
109  public void setMessageTypes(List<MsgTypeEnum> messageTypes) {
110  this.messageTypes = messageTypes;
111  }
112 
113  public List<Integer> getMessageSubTypes() {
114  return messageSubTypes;
115  }
116 
117  public void setMessageSubTypes(List<Integer> messageSubTypes) {
118  this.messageSubTypes = messageSubTypes;
119  }
120 
121  public boolean isAllMessageTypes() {
122  return allMessageTypes;
123  }
124 
125  public void setAllMessageTypes(boolean allMessageTypes) {
126  this.allMessageTypes = allMessageTypes;
127  }
128 
129  public String getSearchContent() {
130  return searchContent;
131  }
132 
133  public void setSearchContent(String searchContent) {
134  this.searchContent = searchContent;
135  }
136 
137  public List<String> getFromIds() {
138  return fromIds;
139  }
140 
141  public void setFromIds(List<String> fromIds) {
142  this.fromIds = fromIds;
143  }
144 
145  public boolean isEnableContentTransfer() {
146  return enableContentTransfer;
147  }
148 
149  public void setEnableContentTransfer(boolean enableContentTransfer) {
150  this.enableContentTransfer = enableContentTransfer;
151  }
152 
153  @Override
154  public String toString() {
155  return "MsgSearchOption{" + "startTime=" + startTime + ", endTime=" + endTime + ", limit=" + limit + ", order=" + order + ", messageTypes=" + messageTypes + ", messageSubTypes=" + messageSubTypes + ", allMessageTypes=" + allMessageTypes + ", searchContent='" + searchContent + '\'' + ", fromIds=" + fromIds + ", enableContentTransfer=" + enableContentTransfer + '}';
156  }
157 }
void setMessageTypes(List< MsgTypeEnum > messageTypes)
void setEnableContentTransfer(boolean enableContentTransfer)
void setMessageSubTypes(List< Integer > messageSubTypes)