Module jakarta.data

Class PageRequestCursor

java.lang.Object
jakarta.data.page.PageRequestCursor
All Implemented Interfaces:
PageRequest.Cursor

class PageRequestCursor extends Object implements PageRequest.Cursor
Built-in implementation of Cursor for cursor-based pagination.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Object[]
    Key values.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a cursor with the specified key values.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<?>
    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
    Returns a hash code based on the key values.
    int
    Returns the number of values in the key.
    String representation of the cursor, including the number of key values in the cursor but not the values themselves.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • key

      private final Object[] 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

      public boolean equals(Object o)
      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 interface PageRequest.Cursor
      Overrides:
      equals in class Object
      Parameters:
      o - a cursor against which to compare.
      Returns:
      true or false.
    • get

      public Object get(int index)
      Description copied from interface: PageRequest.Cursor
      Returns the key value at the specified position.
      Specified by:
      get in interface PageRequest.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 interface PageRequest.Cursor
      Overrides:
      hashCode in class Object
      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 interface PageRequest.Cursor
      Returns:
      the number of values in the key.
    • elements

      public List<?> elements()
      Description copied from interface: PageRequest.Cursor
      An unmodifiable list of values in the key.
      Specified by:
      elements in interface PageRequest.Cursor
      Returns:
      an unmodifiable list containing the ordered values
    • toString

      public String 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 interface PageRequest.Cursor
      Overrides:
      toString in class Object
      Returns:
      String representation of the cursor.