Package jakarta.data.page
Interface PageRequest.Cursor
- Enclosing interface:
- PageRequest
public static interface PageRequest.Cursor
A cursor that is formed from a key, relative to which a next
or previous page can be requested.
-
Method Summary
Modifier and TypeMethodDescriptionList<?>
elements()
An unmodifiable list of values in the key.boolean
Returns whether or not the values that make up the key of this cursor are equal to those of the supplied cursor.static PageRequest.Cursor
Obtain an instance ofCursor
for the given key.get
(int index) Returns the key value at the specified position.int
hashCode()
Returns a hash code based on the key values.int
size()
Returns the number of values in the key.toString()
String representation of the cursor, including the number of key values in the cursor but not the values themselves.
-
Method Details
-
equals
Returns whether or not the values that make up the key of this cursor are equal to those of the supplied cursor. Both instances must also have the same cursor implementation class in order to be considered equal. -
get
Returns the key value at the specified position.- Parameters:
index
- position (0 is first) of the key value to obtain.- Returns:
- the key value at the specified position.
- Throws:
IndexOutOfBoundsException
- if the index is negative or greater than or equal to thesize()
.
-
hashCode
int hashCode()Returns a hash code based on the key values. -
size
int size()Returns the number of values in the key.- Returns:
- the number of values in the key.
-
elements
List<?> elements()An unmodifiable list of values in the key.- Returns:
- an unmodifiable list containing the ordered values
-
toString
String toString()String representation of the cursor, including the number of key values in the cursor but not the values themselves. -
forKey
Obtain an instance ofCursor
for the given key.- Parameters:
key
- the key- Returns:
- a new instance of
Cursor
-