- 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.booleanReturns whether or not the values that make up the key of this cursor are equal to those of the supplied cursor.static PageRequest.CursorCreate aCursorthat has the composite key formed by the given key elements.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.
-
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
Create a
Cursorthat has the composite key formed by the given key elements. Each key element corresponds to the respective entity attribute at the same position within the repository method's sort criteria.The array of key elements as well as the elements within it must not be modified after supplying it to this method.
- Parameters:
key- the composite key to use for theCursor.- Returns:
- a new instance of
Cursor
-