- 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 classFluent API builder forPageRequest.static classPageRequest.BuilderBase<BUILDER extends PageRequest.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends PageRequest> Fluent API builder base forPageRequest. -
Method Summary
Modifier and TypeMethodDescriptionstatic PageRequest.Builderbuilder()Create a new fluent API builder to customize configuration.static PageRequest.Builderbuilder(PageRequest instance) Create a new fluent API builder from an existing instance.static PageRequestcreate()Create a new instance with default values.static PageRequestcreate(int page) Create new instance of pageable query result request with default size of10and no order definitions.static PageRequestcreate(int page, int size) Create new instance of pageable query result request with no order definitions.intoffset()Offset of current page in the requested collection.intpage()Page number.intsize()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 of10and 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
0when no pagination is defined
-
page
int page()Page number.Page number starts from
0.- Returns:
- page number
-
size
int size()Page size.Valid
sizevalues are:-1when no pagination is definedsize > 0for requested page size
- Returns:
- page size
-