public class Cursor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Date |
expiration |
protected java.lang.String |
value |
Constructor and Description |
---|
Cursor(java.lang.String value)
None
|
Cursor(java.lang.String value,
java.util.Date expiration) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.Date |
getExpiration()
Expiration time of
getValue() . |
java.lang.String |
getValue()
The actual cursor value.
|
int |
hashCode() |
java.lang.String |
toString() |
java.lang.String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
protected final java.lang.String value
protected final java.util.Date expiration
public Cursor(java.lang.String value, java.util.Date expiration)
value
- The actual cursor value. Must not be null
.expiration
- Expiration time of getValue()
. Some
cursors might have expiration time assigned. This is a UTC value
after which the cursor is no longer valid and the API starts
returning an error. If cursor expires a new one needs to be obtained
and pagination needs to be restarted. Some cursors might be
short-lived some cursors might be long-lived. This really depends on
the sorting type and order, e.g.: 1. on one hand, listing docs
created by the user, sorted by the created time ascending will have
undefinite expiration because the results cannot change while the
iteration is happening. This cursor would be suitable for long term
polling. 2. on the other hand, listing docs sorted by the last
modified time will have a very short expiration as docs do get
modified very often and the modified time can be changed while the
iteration is happening thus altering the results.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public Cursor(java.lang.String value)
The default values for unset fields will be used.
value
- The actual cursor value. Must not be null
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public java.lang.String getValue()
null
.public java.util.Date getExpiration()
getValue()
. Some cursors might have
expiration time assigned. This is a UTC value after which the cursor is
no longer valid and the API starts returning an error. If cursor expires
a new one needs to be obtained and pagination needs to be restarted. Some
cursors might be short-lived some cursors might be long-lived. This
really depends on the sorting type and order, e.g.: 1. on one hand,
listing docs created by the user, sorted by the created time ascending
will have undefinite expiration because the results cannot change while
the iteration is happening. This cursor would be suitable for long term
polling. 2. on the other hand, listing docs sorted by the last modified
time will have a very short expiration as docs do get modified very often
and the modified time can be changed while the iteration is happening
thus altering the results.null
if not present.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringMultiline()
The returned String may contain newlines.