Class Cursor

java.lang.Object
com.dropbox.core.v2.paper.Cursor

public class Cursor extends Object
  • Field Details

    • value

      @Nonnull protected final String value
    • expiration

      @Nullable protected final Date expiration
  • Constructor Details

    • Cursor

      public Cursor(@Nonnull String value, @Nullable Date expiration)
      Parameters:
      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.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • Cursor

      public Cursor(@Nonnull String value)
      None

      The default values for unset fields will be used.

      Parameters:
      value - The actual cursor value. Must not be null.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
  • Method Details

    • getValue

      @Nonnull public String getValue()
      The actual cursor value.
      Returns:
      value for this field, never null.
    • getExpiration

      @Nullable public Date getExpiration()
      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.
      Returns:
      value for this field, or null if not present.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringMultiline

      public 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