Class Cursor.Builder

java.lang.Object
com.helixframework.pagination.cursor.Cursor.Builder
Enclosing class:
Cursor

public static class Cursor.Builder extends Object
The Builder class is a utility class for creating instances of the Cursor class. It provides methods to set criteria, direction, and build the Cursor.
  • Constructor Details

    • Builder

      public Builder()
      A Builder class for creating instances of the Cursor class.
    • Builder

      public Builder(Cursor prevCursor)
      A Builder class for creating instances of the Cursor class.
      Parameters:
      prevCursor - the previous Cursor object to copy criteria and direction from
  • Method Details

    • criterion

      public Cursor.Builder criterion(String key, String value)
      Adds a criterion to the Cursor Builder.
      Parameters:
      key - the key of the criterion
      value - the value of the criterion
      Returns:
      the updated CursorBuilder instance
    • criterion

      public Cursor.Builder criterion(String key, String value, com.helixframework.pagination.sort.SortOrder sortOrder)
      Adds a criterion to the Cursor Builder.
      Parameters:
      key - the key of the criterion
      value - the value of the criterion
      sortOrder - the sort order of the criterion
      Returns:
      the updated Builder instance
    • criterion

      public Cursor.Builder criterion(String criterion)
      Adds a criterion to the Cursor Builder.
      Parameters:
      criterion - the criterion to be added
      Returns:
      the updated Builder instance
    • criterion

      public Cursor.Builder criterion(Criterion criterion)
      Adds a criterion to the Cursor Builder.
      Parameters:
      criterion - the criterion to be added
      Returns:
      the updated Builder instance
    • direction

      public Cursor.Builder direction(Cursor.Direction dir)
      Sets the direction of the Cursor to the specified direction.
      Parameters:
      dir - the direction to set the Cursor to
      Returns:
      the updated Builder instance
    • forward

      public Cursor.Builder forward()
      Sets the direction of the Cursor to forward (default).
      Returns:
      the updated Builder instance
    • reverse

      public Cursor.Builder reverse()
      Sets the direction of the Cursor to reverse.
      Returns:
      the updated Builder instance
    • build

      public Cursor build()
      Builds a new Cursor object based on the set criteria and direction.
      Returns:
      the newly built Cursor object