Package io.micronaut.data.model
Interface Pageable
- All Superinterfaces:
Sort
Models pageable data. The
from(int, int)
method can be used to construct a new instance to pass to Micronaut Data methods.- Since:
- 1.0.0
- Author:
- boros, graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.data.model.Sort
Sort.Order
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull Pageable
from
(int page) Creates a newPageable
at the given offset with a default size of 10.static @NonNull Pageable
from
(int page, int size) Creates a newPageable
at the given offset.static @NonNull Pageable
Creates a newPageable
at the given offset.static @NonNull Pageable
Creates a newPageable
at the given offset.int
default long
Offset in the requested collection.default @NonNull List<Sort.Order>
int
getSize()
Maximum size of the page to be returned.default @NonNull Sort
getSort()
default boolean
isSorted()
default boolean
default @NonNull Pageable
next()
default @NonNull Pageable
order
(@NonNull Sort.Order order) Adds an order object.default @NonNull Pageable
Orders by the specified property name (defaults to ascending).default @NonNull Pageable
order
(@NonNull String propertyName, Sort.Order.Direction direction) Orders by the specified property name and direction.default @NonNull Pageable
previous()
static @NonNull Pageable
unpaged()
-
Field Details
-
UNPAGED
Constant for no pagination.
-
-
Method Details
-
getNumber
int getNumber()- Returns:
- The page number.
-
getSize
int getSize()Maximum size of the page to be returned. A value of -1 indicates no maximum.- Returns:
- size of the requested page of items
-
getOffset
default long getOffset()Offset in the requested collection. Defaults to zero.- Returns:
- offset in the requested collection
-
getSort
- Returns:
- The sort definition to use.
-
next
- Returns:
- The next pageable.
-
previous
- Returns:
- The previous pageable
-
isUnpaged
default boolean isUnpaged()- Returns:
- Is unpaged
-
order
Description copied from interface:Sort
Orders by the specified property name (defaults to ascending). -
isSorted
default boolean isSorted() -
order
Description copied from interface:Sort
Adds an order object. -
order
@NonNull default @NonNull Pageable order(@NonNull @NonNull String propertyName, @NonNull Sort.Order.Direction direction) Description copied from interface:Sort
Orders by the specified property name and direction. -
getOrderBy
- Specified by:
getOrderBy
in interfaceSort
- Returns:
- The order definitions for this sort.
-
from
Creates a newPageable
at the given offset with a default size of 10.- Parameters:
page
- The page- Returns:
- The pageable
-
from
Creates a newPageable
at the given offset.- Parameters:
page
- The pagesize
- the size- Returns:
- The pageable
-
from
Creates a newPageable
at the given offset.- Parameters:
page
- The pagesize
- the sizesort
- the sort- Returns:
- The pageable
-
from
Creates a newPageable
at the given offset.- Parameters:
sort
- the sort- Returns:
- The pageable
-
unpaged
- Returns:
- A new instance without paging data.
-