Package io.micronaut.data.model
Interface CursoredPageable
Models a pageable request that uses a cursor.
- Since:
- 4.8.0
- Author:
- Andriy Dmytruk
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.data.model.Pageable
Pageable.Cursor, Pageable.Mode
Nested classes/interfaces inherited from interface io.micronaut.data.model.Sort
Sort.Order
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull CursoredPageable
from
(int page, @Nullable Pageable.Cursor cursor, Pageable.Mode mode, int size, @Nullable Sort sort, boolean requestTotal) Creates a newCursoredPageable
with the given currentCursor.static @NonNull CursoredPageable
Creates a newCursoredPageable
with the given sort and page size.static @NonNull CursoredPageable
Creates a newCursoredPageable
with the given sort.default Pageable.Mode
getMode()
The pagination mode that is either offset pagination, currentCursor forward or currentCursor backward pagination.boolean
Whether the pageable is traversing backwards.
-
Method Details
-
isBackward
boolean isBackward()Whether the pageable is traversing backwards.- Returns:
- Whether currentCursor is going in reverse direction.
-
getMode
Description copied from interface:Pageable
The pagination mode that is either offset pagination, currentCursor forward or currentCursor backward pagination. -
from
Creates a newCursoredPageable
with the given sort.- Parameters:
sort
- The sort- Returns:
- The pageable
-
from
Creates a newCursoredPageable
with the given sort and page size.- Parameters:
size
- The page sizesort
- 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 newCursoredPageable
with the given currentCursor.- Parameters:
page
- The pagecursor
- 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 sizesort
- The sortrequestTotal
- Whether to request total count- Returns:
- The pageable
-