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