@PublicApi public final class PageRequests extends Object
PageRequest
instances.Constructor and Description |
---|
PageRequests() |
Modifier and Type | Method and Description |
---|---|
static PageRequest |
limit(PageRequest pageRequest,
int maxSize)
Takes a page request and if its
limit is greater than maxSize then
returns a new page request with limit equal to maxSize . |
static PageRequest |
request(Long start,
Integer limit)
Creates an instance of
PageRequest . |
public static PageRequest request(@Nullable Long start, @Nullable Integer limit)
PageRequest
.
Start of the page request can't be lower then 0 and the limit must be a number greater then 0 but lower then PageRequest.MAX_PAGE_LIMIT
.
start
- values offset, will be set to 0 if null
limit
- maximum number of results on a page, will be set to PageRequest.MAX_PAGE_LIMIT
if null
public static PageRequest limit(PageRequest pageRequest, int maxSize)
limit
is greater than maxSize
then
returns a new page request with limit
equal to maxSize
. Otherwise
the same page request is returned.pageRequest
- original page requestmaxSize
- maximum limit in page requestCopyright © 2002-2023 Atlassian. All Rights Reserved.