NIMSDK-AOS  9.20.10
GetMessagesByTagsParam.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.chatroom.model;
2 
3 import com.netease.nimlib.notifier.support26.annotation.NonNull;
5 
6 import java.util.List;
7 
8 public class GetMessagesByTagsParam {
9  /**
10  * 聊天室ID
11  */
12  private final long roomId;
13  /**
14  * 标签
15  */
16  private final List<String> tags;
17 
18  /**
19  * 消息类型列表
20  * 只查询指定消息类型的消息
21  */
22  private List<MsgTypeEnum> types;
23  /**
24  * 起始时间ms
25  */
26  private Long fromTime;
27  /**
28  * 结束时间ms
29  */
30  private Long toTime;
31  /**
32  * 最大消息数量
33  */
34  private Integer limit;
35  /**
36  * 是否反向
37  */
38  private Boolean reverse;
39 
40  /**
41  * 构造函数
42  *
43  * @param roomId 聊天室ID
44  * @param tags 标签
45  */
46  public GetMessagesByTagsParam(long roomId, @NonNull List<String> tags) {
47  this.roomId = roomId;
48  this.tags = tags;
49  }
50 
51  /**
52  * @return 聊天室ID
53  */
54  public long getRoomId() {
55  return roomId;
56  }
57 
58  /**
59  * @return 标签
60  */
61  public List<String> getTags() {
62  return tags;
63  }
64 
65  /**
66  * 只查询指定消息类型的
67  * @return 消息类型
68  */
69  public List<MsgTypeEnum> getTypes() {
70  return types;
71  }
72 
73  /**
74  * 设置消息类型限制,只查询指定消息类型的消息
75  * @param types 消息类型
76  */
77  public void setTypes(List<MsgTypeEnum> types) {
78  this.types = types;
79  }
80 
81  /**
82  * 起始时间限制,只查询≥起始时间的消息
83  * @return 起始时间ms
84  */
85  public Long getFromTime() {
86  return fromTime;
87  }
88 
89  /**
90  * 设置起始时间限制,只查询≥起始时间的消息
91  * @param fromTime 起始时间ms
92  */
93  public void setFromTime(Long fromTime) {
94  this.fromTime = fromTime;
95  }
96 
97  /**
98  * 结束时间限制,只查询≤结束时间的消息
99  * @return 结束时间
100  */
101  public Long getToTime() {
102  return toTime;
103  }
104 
105  /**
106  * 设置结束时间限制,只查询≤结束时间的消息
107  * @param toTime 结束时间ms
108  */
109  public void setToTime(Long toTime) {
110  this.toTime = toTime;
111  }
112 
113  /**
114  * 数量限制,只结果只包含前面指定条数的消息
115  * @return 最大消息数量
116  */
117  public Integer getLimit() {
118  return limit;
119  }
120 
121  /**
122  * 设置数量限制,只结果只包含前面指定条数的消息
123  * @param limit 最大消息数量
124  */
125  public void setLimit(Integer limit) {
126  this.limit = limit;
127  }
128 
129  /**
130  * 查询顺序
131  * @return 是否反向
132  */
133  public Boolean getReverse() {
134  return reverse;
135  }
136 
137  /**
138  * 设置查询顺序
139  * @param reverse 是否反向
140  */
141  public void setReverse(Boolean reverse) {
142  this.reverse = reverse;
143  }
144 
145  @Override
146  public String toString() {
147  return "GetMessagesByTagsParam{" +
148  "roomId=" + roomId +
149  ", tags=" + tags +
150  ", messageTypes=" + types +
151  ", fromTime=" + fromTime +
152  ", toTime=" + toTime +
153  ", limit=" + limit +
154  ", reverse=" + reverse +
155  '}';
156  }
157 }
void setToTime(Long toTime)
设置结束时间限制,只查询≤结束时间的消息
Long getToTime()
结束时间限制,只查询≤结束时间的消息
void setFromTime(Long fromTime)
设置起始时间限制,只查询≥起始时间的消息
Integer getLimit()
数量限制,只结果只包含前面指定条数的消息
GetMessagesByTagsParam(long roomId,@NonNull List< String > tags)
构造函数
void setLimit(Integer limit)
设置数量限制,只结果只包含前面指定条数的消息
List< MsgTypeEnum > getTypes()
只查询指定消息类型的
void setTypes(List< MsgTypeEnum > types)
设置消息类型限制,只查询指定消息类型的消息
Long getFromTime()
起始时间限制,只查询≥起始时间的消息