- All Superinterfaces:
Prototype.Api
- All Known Implementing Classes:
PageRequest.BuilderBase.PageRequestImpl
Request pageable query result as page with page number and size.
PageRequest
argument of the repository interface query method sets
parameters of the page (represented by Slice
or Page
interfaces)
to be returned by the query.
Repository interface method must always be of Slice
or Page
type when
it contains PageRequest
argument.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Fluent API builder forPageRequest
.static class
PageRequest.BuilderBase<BUILDER extends PageRequest.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends PageRequest> Fluent API builder base forPageRequest
. -
Method Summary
Modifier and TypeMethodDescriptionstatic PageRequest.Builder
builder()
Create a new fluent API builder to customize configuration.static PageRequest.Builder
builder
(PageRequest instance) Create a new fluent API builder from an existing instance.static PageRequest
create()
Create a new instance with default values.static PageRequest
create
(int page) Create new instance of pageable query result request with default size of10
and no order definitions.static PageRequest
create
(int page, int size) Create new instance of pageable query result request with no order definitions.int
offset()
Offset of current page in the requested collection.int
page()
Page number.int
size()
Page size.
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance
- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance with default values.- Returns:
- a new instance
-
create
Create new instance of pageable query result request with no order definitions.- Parameters:
page
- page numbersize
- requested page size- Returns:
- pageable query result request
-
create
Create new instance of pageable query result request with default size of10
and no order definitions.- Parameters:
page
- page number- Returns:
- pageable query result request
-
offset
int offset()Offset of current page in the requested collection.- Returns:
- collection offset or
0
when no pagination is defined
-
page
int page()Page number.Page number starts from
0
.- Returns:
- page number
-
size
int size()Page size.Valid
size
values are:-1
when no pagination is definedsize > 0
for requested page size
- Returns:
- page size
-