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.
This class should be used only for paginating content on the frontend or handling paginated requests.
For searching objects in the index, use PageRequest-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PageRequestlimit(PageRequest pageRequest, int maxSize) Takes a page request and if itslimitis greater thanmaxSizethen returns a new page request withlimitequal tomaxSize.static PageRequestCreates an instance ofPageRequest.
-
Constructor Details
-
PageRequests
public PageRequests()
-
-
Method Details
-
request
Creates an instance ofPageRequest.Start of the page request can't be lower than 0 and the limit must be a number greater than 0 but lower than
PageRequest.MAX_PAGE_LIMIT.- Parameters:
start- values offset, will be set to 0 ifnulllimit- maximum number of results on a page, will be set toPageRequest.MAX_PAGE_LIMITifnull- Returns:
- a page request object
-
limit
Takes a page request and if itslimitis greater thanmaxSizethen returns a new page request withlimitequal 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
-