@PublicApi public class

PagerFilter

extends Object
implements Serializable
java.lang.Object
   ↳ com.atlassian.jira.web.bean.PagerFilter<T>
Known Direct Subclasses

@PublicApi

This class is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

This is a super class that implements paging for browsers.

Most other filters (which want paging ability) will extend this.

Summary

Fields
protected Collection<Page> pages This field is deprecated. since 4.0 use #getPages() rather than access pages directly
Public Constructors
PagerFilter()
PagerFilter(PagerFilter old)
PagerFilter(int max)
PagerFilter(int start, int max)
Public Methods
List<Page> generatePages(Collection<T> items)
generates a collection of page objects which keep track of the pages for display
List<T> getCurrentPage(List<T> itemsCol)
Gets the current page out of a list of objects.
int getEnd()
int getMax()
int getNextStart()
int getPageSize()
List<Page> getPages(Collection<T> itemsCol)
int getPreviousStart()
int getStart()
static PagerFilter getUnlimitedFilter()
A pager that will return unlimited number of objects.
static PagerFilter newPageAlignedFilter(int index, int max)
A pager that has its start aligned to the page containing the index.
List<Page> restrictPages(Collection<Page> pages, int size)
Restrict the pagers to a certain number of pages on either side of the current page.
void setMax(int max)
void setStart(int start)
String toString()
Protected Methods
Collection<Page> getPages()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected Collection<Page> pages

This field is deprecated.
since 4.0 use #getPages() rather than access pages directly

A collection of Page objects

Public Constructors

public PagerFilter ()

public PagerFilter (PagerFilter old)

public PagerFilter (int max)

public PagerFilter (int start, int max)

Public Methods

public List<Page> generatePages (Collection<T> items)

generates a collection of page objects which keep track of the pages for display

public List<T> getCurrentPage (List<T> itemsCol)

Gets the current page out of a list of objects.

Returns
  • the sublist that is the current page.

public int getEnd ()

public int getMax ()

public int getNextStart ()

public int getPageSize ()

public List<Page> getPages (Collection<T> itemsCol)

public int getPreviousStart ()

public int getStart ()

public static PagerFilter getUnlimitedFilter ()

A pager that will return unlimited number of objects.

Returns

public static PagerFilter newPageAlignedFilter (int index, int max)

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 at
max 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

public List<Page> restrictPages (Collection<Page> pages, int size)

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.

public void setMax (int max)

public void setStart (int start)

public String toString ()

Protected Methods

protected Collection<Page> getPages ()