Class Cursor.Builder
java.lang.Object
com.helixframework.pagination.cursor.Cursor.Builder
- Enclosing class:
- Cursor
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newCursorobject based on the set criteria and direction.Adds a criterion to the Cursor Builder.Adds a criterion to the Cursor Builder.Adds a criterion to the Cursor Builder.Adds a criterion to the Cursor Builder.Sets the direction of the Cursor to the specified direction.forward()Sets the direction of the Cursor to forward (default).reverse()Sets the direction of the Cursor to reverse.
-
Constructor Details
-
Builder
public Builder()A Builder class for creating instances of the Cursor class. -
Builder
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
Adds a criterion to the Cursor Builder.- Parameters:
key- the key of the criterionvalue- 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 criterionvalue- the value of the criterionsortOrder- the sort order of the criterion- Returns:
- the updated Builder instance
-
criterion
Adds a criterion to the Cursor Builder.- Parameters:
criterion- the criterion to be added- Returns:
- the updated Builder instance
-
criterion
Adds a criterion to the Cursor Builder.- Parameters:
criterion- the criterion to be added- Returns:
- the updated Builder instance
-
direction
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
Sets the direction of the Cursor to forward (default).- Returns:
- the updated Builder instance
-
reverse
Sets the direction of the Cursor to reverse.- Returns:
- the updated Builder instance
-
build
Builds a newCursorobject based on the set criteria and direction.- Returns:
- the newly built Cursor object
-