Interface CursoredPageable

All Superinterfaces:
Pageable, Sort

@Introspected public interface CursoredPageable extends Pageable
Models a pageable request that uses a cursor.
Since:
4.8.0
Author:
Andriy Dmytruk
  • Method Details

    • isBackward

      boolean isBackward()
      Whether the pageable is traversing backwards.
      Returns:
      Whether currentCursor is going in reverse direction.
    • getMode

      default Pageable.Mode getMode()
      Description copied from interface: Pageable
      The pagination mode that is either offset pagination, currentCursor forward or currentCursor backward pagination.
      Specified by:
      getMode in interface Pageable
      Returns:
      The pagination mode
    • from

      @NonNull static @NonNull CursoredPageable from(Sort sort)
      Creates a new CursoredPageable with the given sort.
      Parameters:
      sort - The sort
      Returns:
      The pageable
    • from

      @NonNull static @NonNull CursoredPageable from(int size, @Nullable @Nullable Sort sort)
      Creates a new CursoredPageable with the given sort and page size.
      Parameters:
      size - The page size
      sort - The sort
      Returns:
      The pageable
    • from

      @Internal @NonNull static @NonNull CursoredPageable from(int page, @Nullable @Nullable Pageable.Cursor cursor, Pageable.Mode mode, int size, @Nullable @Nullable Sort sort, boolean requestTotal)
      Creates a new CursoredPageable with the given currentCursor.
      Parameters:
      page - The page
      cursor - The current currentCursor that will be used for querying data.
      mode - The pagination mode. Must be either forward or backward currentCursor pagination.
      size - The page size
      sort - The sort
      requestTotal - Whether to request total count
      Returns:
      The pageable
    • withoutSort

      CursoredPageable withoutSort()
      Description copied from interface: Pageable
      Removes ordering.
      Specified by:
      withoutSort in interface Pageable
      Returns:
      A pageable without ordering
    • withoutPaging

      CursoredPageable withoutPaging()
      Description copied from interface: Pageable
      Removes paging.
      Specified by:
      withoutPaging in interface Pageable
      Returns:
      A pageable without paging
    • withSort

      CursoredPageable withSort(Sort sort)
      Description copied from interface: Pageable
      Creates a new Pageable with a custom sort.
      Specified by:
      withSort in interface Pageable
      Parameters:
      sort - a new sort
      Returns:
      A pageable instance with a new sort
    • withTotal

      CursoredPageable withTotal()
      Description copied from interface: Pageable
      Specify that the Page response should have information about total size.
      Specified by:
      withTotal in interface Pageable
      Returns:
      A pageable instance that will request the total size.
      See Also:
    • withoutTotal

      CursoredPageable withoutTotal()
      Description copied from interface: Pageable
      Specify that the Page response should not have information about total size.
      Specified by:
      withoutTotal in interface Pageable
      Returns:
      A pageable instance that won't request the total size.
      See Also:
    • orders

      CursoredPageable orders(List<Sort.Order> orders)
      Description copied from interface: Sort
      Adds an orders.
      Specified by:
      orders in interface Pageable
      Specified by:
      orders in interface Sort
      Parameters:
      orders - The orders
      Returns:
      A new sort with the order applied