Class Paginator
- java.lang.Object
-
- com.atlassian.bamboo.plugins.rest.common.Paginator
-
public class Paginator extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_RESULTS
-
Constructor Summary
Constructors Constructor Description Paginator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Collection<T>
getLast(Collection<T> input, javax.ws.rs.core.UriInfo uriInfo)
static int
getMaxResults(javax.ws.rs.core.UriInfo uriInfo)
static int
getMaxResults(javax.ws.rs.core.UriInfo uriInfo, int defaultValue)
static org.apache.commons.lang3.Range<Integer>
getPaginationRange(int resultSize, javax.ws.rs.core.UriInfo uriInfo)
static <T> org.apache.commons.lang3.Range<Integer>
getPaginationRange(Collection<T> input, javax.ws.rs.core.UriInfo uriInfo)
static org.apache.commons.lang3.Range<Integer>
getPaginationRange(javax.ws.rs.core.UriInfo uriInfo)
static <T> PagerPaginationSupport
getPaginationSupport(com.atlassian.user.search.page.Pager<T> pager, javax.ws.rs.core.UriInfo uriInfo)
static int
getStartIndex(javax.ws.rs.core.UriInfo uriInfo, int maxResults)
static <T> List<T>
paginate(Collection<T> input, org.apache.commons.lang3.Range<Integer> range)
-
-
-
Field Detail
-
DEFAULT_MAX_RESULTS
public static final int DEFAULT_MAX_RESULTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLast
public static <T> Collection<T> getLast(Collection<T> input, javax.ws.rs.core.UriInfo uriInfo)
-
getStartIndex
public static int getStartIndex(javax.ws.rs.core.UriInfo uriInfo, int maxResults)
-
getMaxResults
public static int getMaxResults(javax.ws.rs.core.UriInfo uriInfo)
-
getMaxResults
public static int getMaxResults(javax.ws.rs.core.UriInfo uriInfo, int defaultValue)
-
getPaginationRange
public static org.apache.commons.lang3.Range<Integer> getPaginationRange(javax.ws.rs.core.UriInfo uriInfo)
-
getPaginationRange
public static org.apache.commons.lang3.Range<Integer> getPaginationRange(int resultSize, javax.ws.rs.core.UriInfo uriInfo)
-
getPaginationRange
public static <T> org.apache.commons.lang3.Range<Integer> getPaginationRange(Collection<T> input, javax.ws.rs.core.UriInfo uriInfo)
-
getPaginationSupport
public static <T> PagerPaginationSupport getPaginationSupport(com.atlassian.user.search.page.Pager<T> pager, javax.ws.rs.core.UriInfo uriInfo)
-
paginate
public static <T> List<T> paginate(Collection<T> input, org.apache.commons.lang3.Range<Integer> range)
-
-