Package com.atlassian.jira.web.bean
Class PagerFilter<T>
java.lang.Object
com.atlassian.jira.web.bean.PagerFilter<T>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GroupBrowserFilter,UserBrowserFilter,UserPickerFilter
This is a super class that implements paging for browsers.
Most other filters (which want paging ability) will extend this. It defines bounds from start to start + max, making max the page size.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPagerFilter(int max) A pager that will return max objectsPagerFilter(int start, int max) A pager that will return objects from start to start + maxPagerFilter(PagerFilter old) -
Method Summary
Modifier and TypeMethodDescriptiongeneratePages(int itemCount) generates a collection of page objects which keep track of the pages for displaygeneratePages(Collection<T> items) generates a collection of page objects which keep track of the pages for displaygetCurrentPage(List<T> itemsCol) Gets the current page out of a list of objects.intgetEnd()intgetMax()intprotected Collection<Page> getPages()getPages(int itemCount) getPages(Collection<T> itemsCol) intintintgetStart()static PagerFilterDeprecated, for removal: This API element is subject to removal in a future version.Unlimited filters are discouraged due to potential performance issues.static PagerFilternewPageAlignedFilter(int index, int max) A pager that has its start aligned to the page containing the index.restrictPages(Collection<Page> pages, int size) Restrict the pagers to a certain number of pages on either side of the current page.voidsetMax(int max) voidsetStart(int start) toString()
-
Field Details
-
pages
-
-
Constructor Details
-
PagerFilter
public PagerFilter() -
PagerFilter
-
PagerFilter
public PagerFilter(int max) A pager that will return max objects- Parameters:
max- the maximum number of results in a page
-
PagerFilter
public PagerFilter(int start, int max) A pager that will return objects from start to start + max- Parameters:
start- the starting point for the pagemax- the maximum number of results in a page
-
-
Method Details
-
getUnlimitedFilter
Deprecated, for removal: This API element is subject to removal in a future version.Unlimited filters are discouraged due to potential performance issues. UseSearchService.streamSearch(com.atlassian.jira.user.ApplicationUser, com.atlassian.query.Query)for unlimited results.A pager that will return unlimited number of objects.Deprecation warning: Unlimited pagers are not supported by
SearchPlatform.OPENSEARCH. The default maximum results for OpenSearch is 10,000. To fetch more than 10,000 results, useSearchService.streamSearch(com.atlassian.jira.user.ApplicationUser, com.atlassian.query.Query)instead.- Returns:
- A PagerFilter with max results set to
Integer.MAX_VALUE
-
newPageAlignedFilter
A pager that has its start aligned to the page containing the index.- Parameters:
index- the index of a result whose page you want the pager to start atmax- the maximum number of results in a page- Returns:
- a new pager aligned to the page containing the index
- Throws:
IllegalArgumentException- if index is less than 0
-
getCurrentPage
Gets the current page out of a list of objects.- Returns:
- the sublist that is the current page.
-
getPages
-
getPages
-
getPages
-
generatePages
generates a collection of page objects which keep track of the pages for display- Parameters:
items- the items to be paged
-
generatePages
generates a collection of page objects which keep track of the pages for display- Parameters:
itemCount- the number of items to be paged
-
restrictPages
Restrict the pagers to a certain number of pages on either side of the current page.The number of pages to list is stored in
PAGES_TO_LIST. -
getMax
public int getMax() -
getPageSize
public int getPageSize() -
setMax
public void setMax(int max) -
getStart
public int getStart() -
setStart
public void setStart(int start) -
getEnd
public int getEnd() -
getNextStart
public int getNextStart() -
getPreviousStart
public int getPreviousStart() -
toString
-