1 package com.netease.nimlib.sdk.v2.message.option;
5 import java.io.Serializable;
10 private final long beginTime;
14 private final long endTime;
34 private final int limit;
38 private final int collectionType;
41 this(0, 0, null, DEFAULT_DIRECTION, DEFAULT_LIMIT, 0);
45 this.beginTime = beginTime;
46 this.endTime = endTime;
47 this.anchorCollection = anchorCollection;
48 this.direction = direction == null ? DEFAULT_DIRECTION : direction;
50 this.collectionType = collectionType;
62 return anchorCollection;
66 if (direction == null) {
67 return DEFAULT_DIRECTION;
78 return collectionType;
83 return "V2NIMCollectionOption{" +
84 "beginTime=" + beginTime +
85 ", endTime=" + endTime +
86 ", anchorCollection=" + anchorCollection +
87 ", direction=" + direction +
89 ", collectionType=" + collectionType +
94 private final static int DEFAULT_LIMIT = 100;
96 public static final class V2NIMCollectionOptionBuilder {
97 private long beginTime;
101 private int limit = DEFAULT_LIMIT;
102 private int collectionType;
104 private V2NIMCollectionOptionBuilder() {
107 public static V2NIMCollectionOptionBuilder builder() {
108 return new V2NIMCollectionOptionBuilder();
111 public V2NIMCollectionOptionBuilder withBeginTime(
long beginTime) {
112 this.beginTime = beginTime;
116 public V2NIMCollectionOptionBuilder withEndTime(
long endTime) {
117 this.endTime = endTime;
122 this.direction = direction;
126 public V2NIMCollectionOptionBuilder withAnchorCollection(
V2NIMCollection anchorCollection) {
127 this.anchorCollection = anchorCollection;
131 public V2NIMCollectionOptionBuilder withLimit(
int limit) {
136 public V2NIMCollectionOptionBuilder withCollectionType(
int collectionType) {
137 this.collectionType = collectionType;
142 return new V2NIMCollectionOption(beginTime, endTime, anchorCollection, direction, limit, collectionType);
V2NIM_QUERY_DIRECTION_DESC
V2NIMQueryDirection getDirection()
V2NIMCollection getAnchorCollection()