1 package com.netease.nimlib.sdk.v2.topic.option;
3 import android.text.TextUtils;
16 private static final int MAX_LIMIT = 100;
25 private final long beginTime;
29 private final long endTime;
39 private final int limit;
63 this.beginTime = beginTime;
64 this.endTime = endTime;
65 this.anchorMessage = anchorMessage;
104 return anchorMessage;
141 return "topic is null";
144 return "topic conversationId is empty";
147 return "topicId must be greater than 0";
150 return "topic createTime must be greater than 0";
153 return "topic messageClientId is empty";
156 return "topic messageServerId must be greater than 0";
159 return "topic messageTime must be greater than 0";
162 return "limit must be greater than 0";
164 if (limit > MAX_LIMIT) {
165 return "limit must be less than or equal to 100";
168 return "beginTime must be greater than or equal to 0";
171 return "endTime must be greater than or equal to 0";
173 if (endTime != 0 && beginTime > endTime) {
174 return "beginTime must be less than or equal to endTime";
176 if (anchorMessage == null) {
180 if (anchorTime < beginTime) {
181 return "anchorMessage createTime must be greater than or equal to beginTime";
183 if (endTime != 0 && anchorTime > endTime) {
184 return "anchorMessage createTime must be less than or equal to endTime";
V2NIMMessage getAnchorMessage()
返回锚点消息。
String getMessageServerId()
返回根消息服务端 ID。
long getMessageTime()
返回根消息时间戳。
String getMessageClientId()
返回根消息客户端 ID。
V2NIMTopic getTopic()
返回查询目标 Topic。
long getBeginTime()
返回起始时间。
V2NIM_QUERY_DIRECTION_DESC
long getCreateTime()
获取消息时间,服务器器时间
String getConversationId()
返回 Topic 所属会话 ID。
long getTopicId()
返回 Topic ID。
V2NIMTopicMessageListOption(V2NIMTopic topic, long beginTime, long endTime, V2NIMMessage anchorMessage, int limit, V2NIMQueryDirection direction, V2NIMSortOrder sortOrder)
构造 Topic 消息列表查询参数。
V2NIMSortOrder getSortOrder()
返回结果排序。
V2NIMQueryDirection getDirection()
返回查询方向。
long getCreateTime()
返回 Topic 创建时间。
String isValidWithErrorMsg()
返回参数非法原因。