java.lang.Object
jakarta.data.page.PageRequestCursor
- All Implemented Interfaces:
PageRequest.Cursor
Built-in implementation of Cursor for cursor-based pagination.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPageRequestCursor
(Object... key) Constructs a cursor with the specified key values. -
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.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.
-
Field Details
-
key
Key values.
-
-
Constructor Details
-
PageRequestCursor
PageRequestCursor(Object... key) Constructs a cursor with the specified key values.- Parameters:
key
- key values.- Throws:
IllegalArgumentException
- if no key values are provided.
-
-
Method Details
-
equals
Description copied from interface:PageRequest.Cursor
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.- Specified by:
equals
in interfacePageRequest.Cursor
- Overrides:
equals
in classObject
- Parameters:
o
- a cursor against which to compare.- Returns:
- true or false.
-
get
Description copied from interface:PageRequest.Cursor
Returns the key value at the specified position.- Specified by:
get
in interfacePageRequest.Cursor
- Parameters:
index
- position (0 is first) of the key value to obtain.- Returns:
- the key value at the specified position.
-
hashCode
public int hashCode()Description copied from interface:PageRequest.Cursor
Returns a hash code based on the key values.- Specified by:
hashCode
in interfacePageRequest.Cursor
- Overrides:
hashCode
in classObject
- Returns:
- a hash code based on the key values.
-
size
public int size()Description copied from interface:PageRequest.Cursor
Returns the number of values in the key.- Specified by:
size
in interfacePageRequest.Cursor
- Returns:
- the number of values in the key.
-
elements
Description copied from interface:PageRequest.Cursor
An unmodifiable list of values in the key.- Specified by:
elements
in interfacePageRequest.Cursor
- Returns:
- an unmodifiable list containing the ordered values
-
toString
Description copied from interface:PageRequest.Cursor
String representation of the cursor, including the number of key values in the cursor but not the values themselves.- Specified by:
toString
in interfacePageRequest.Cursor
- Overrides:
toString
in classObject
- Returns:
- String representation of the cursor.
-