Class PageRequestCursor
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.booleanReturns 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.inthashCode()Returns a hash code based on the key values.intsize()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.CursorReturns 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:
equalsin interfacePageRequest.Cursor- Overrides:
equalsin classObject- Parameters:
o- a cursor against which to compare.- Returns:
- true or false.
-
get
Description copied from interface:PageRequest.CursorReturns the key value at the specified position.- Specified by:
getin 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.CursorReturns a hash code based on the key values.- Specified by:
hashCodein interfacePageRequest.Cursor- Overrides:
hashCodein classObject- Returns:
- a hash code based on the key values.
-
size
public int size()Description copied from interface:PageRequest.CursorReturns the number of values in the key.- Specified by:
sizein interfacePageRequest.Cursor- Returns:
- the number of values in the key.
-
elements
Description copied from interface:PageRequest.CursorAn unmodifiable list of values in the key.- Specified by:
elementsin interfacePageRequest.Cursor- Returns:
- an unmodifiable list containing the ordered values
-
toString
Description copied from interface:PageRequest.CursorString representation of the cursor, including the number of key values in the cursor but not the values themselves.- Specified by:
toStringin interfacePageRequest.Cursor- Overrides:
toStringin classObject- Returns:
- String representation of the cursor.
-