Package com.dropbox.core.v2.paper
Class Cursor
- java.lang.Object
-
- com.dropbox.core.v2.paper.Cursor
-
public class Cursor extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Date
expiration
protected java.lang.String
value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.util.Date
getExpiration()
Expiration time ofgetValue()
.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.
-
-
-
Constructor Detail
-
Cursor
public Cursor(@Nonnull java.lang.String value, @Nullable java.util.Date expiration)
- Parameters:
value
- The actual cursor value. Must not benull
.expiration
- Expiration time ofgetValue()
. 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.- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
Cursor
public Cursor(@Nonnull java.lang.String value)
NoneThe default values for unset fields will be used.
- Parameters:
value
- The actual cursor value. Must not benull
.- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
-
Method Detail
-
getValue
@Nonnull public java.lang.String getValue()
The actual cursor value.- Returns:
- value for this field, never
null
.
-
getExpiration
@Nullable public java.util.Date getExpiration()
Expiration time ofgetValue()
. 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.- Returns:
- value for this field, or
null
if not present.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toStringMultiline
public java.lang.String toStringMultiline()
Returns a String representation of this object formatted for easier readability.The returned String may contain newlines.
- Returns:
- Formatted, multiline String representation of this object
-
-