Package com.atlassian.jira.util
Class PageRequests
java.lang.Object
com.atlassian.jira.util.PageRequests
Class containing static factory methods used to create
PageRequest
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PageRequest
limit
(PageRequest pageRequest, int maxSize) Takes a page request and if itslimit
is greater thanmaxSize
then returns a new page request withlimit
equal tomaxSize
.static PageRequest
Creates an instance ofPageRequest
.
-
Constructor Details
-
PageRequests
public PageRequests()
-
-
Method Details
-
request
Creates an instance ofPageRequest
.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
.- Parameters:
start
- values offset, will be set to 0 ifnull
limit
- maximum number of results on a page, will be set toPageRequest.MAX_PAGE_LIMIT
ifnull
- Returns:
- a page request object
-
limit
Takes a page request and if itslimit
is greater thanmaxSize
then returns a new page request withlimit
equal tomaxSize
. Otherwise the same page request is returned.- Parameters:
pageRequest
- original page requestmaxSize
- maximum limit in page request- Returns:
- page request with limit no greater than maxSize
-