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