NIMSDK-AOS  9.16.0
QueryThreadTalkHistoryOption.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.msg.model;
2 
3 import java.io.Serializable;
4 
8 public class QueryThreadTalkHistoryOption implements Serializable {
9  private long fromTime;
10  private long toTime;
11  private long excludeMessageServerId;
12  private int limit;
13  private QueryDirectionEnum direction;
14  private boolean persist;
15 
23  public long getFromTime() {
24  return fromTime;
25  }
26 
31  public void setFromTime(long fromTime) {
32  this.fromTime = fromTime;
33  }
34 
40  public long getToTime() {
41  return toTime;
42  }
43 
48  public void setToTime(long toTime) {
49  this.toTime = toTime;
50  }
51 
62  public long getExcludeMessageServerId() {
63  return excludeMessageServerId;
64  }
65 
69  public void setExcludeMessageServerId(long excludeMessageServerId) {
70  this.excludeMessageServerId = excludeMessageServerId;
71  }
72 
76  public int getLimit() {
77  return limit;
78  }
79 
83  public void setLimit(int limit) {
84  this.limit = limit;
85  }
86 
92  return direction;
93  }
94 
98  public void setDirection(QueryDirectionEnum direction) {
99  this.direction = direction;
100  }
101 
105  public boolean isPersist() {
106  return persist;
107  }
108 
112  public void setPersist(boolean persist) {
113  this.persist = persist;
114  }
115 
116  public boolean isValid() {
117  return fromTime >= 0 && toTime >= fromTime && excludeMessageServerId >= 0 && limit >= 0;
118  }
119 
120  @Override
121  public String toString() {
122  return "QueryThreadTalkHistoryOption{" +
123  "fromTime=" + fromTime +
124  ", toTime=" + toTime +
125  ", excludeMessageServerId=" + excludeMessageServerId +
126  ", limit=" + limit +
127  ", direction=" + direction +
128  ", persist=" + persist +
129  '}';
130  }
131 }
long getFromTime()
获取 查询起始时间。 查询起始时间 <= 查询终止时间
void setToTime(long toTime)
设置 查询终止时间。 查询终止时间 >= 查询起始时间
void setDirection(QueryDirectionEnum direction)
设置 查询方向:早于或晚于锚点
void setFromTime(long fromTime)
设置 查询起始时间。 查询起始时间 <= 查询终止时间
查询服务端 Thread 历史消息接口的分页参数
void setExcludeMessageServerId(long excludeMessageServerId)
设置 要排除的消息服务器ID
boolean isPersist()
获取 查询结果是否同步到本地数据库
long getToTime()
获取 查询终止时间。 查询结果包括查询终止时间点上的消息 查询终止时间 >= 查询起始时间 ...
QueryDirectionEnum getDirection()
获取 查询方向:早于或晚于锚点 同时也是查询结果的排序方式
long getExcludeMessageServerId()
获取 要排除的消息服务器ID(生效时,对应消息为查询锚点) 如果该字段有效,该消息服务器ID对应的消息不会出...
void setPersist(boolean persist)
设置 查询结果是否同步到本地数据库