public class PaginationImpl extends Object implements Pagination
Modifier and Type | Class and Description |
---|---|
static class |
PaginationImpl.PaginationKey
Denotes the internal field names for paging.
|
Modifier and Type | Field and Description |
---|---|
static Map<String,PaginationImpl.PaginationKey> |
PAGE_KEYS |
static String |
PAGE_LIMIT_KEY |
static String |
PAGE_NUMBER_KEY |
static String |
PAGE_OFFSET_KEY |
static String |
PAGE_SIZE_KEY |
static String |
PAGE_TOTALS_KEY |
DEFAULT_OFFSET, DEFAULT_PAGE_LIMIT, MAX_PAGE_LIMIT
Constructor and Description |
---|
PaginationImpl(Class<?> entityClass,
Integer clientOffset,
Integer clientLimit,
int systemDefaultLimit,
int systemMaxLimit,
Boolean generateTotals,
Boolean pageByPages)
Constructor.
|
PaginationImpl(Type<?> entityClass,
Integer clientOffset,
Integer clientLimit,
int systemDefaultLimit,
int systemMaxLimit,
Boolean generateTotals,
Boolean pageByPages)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static PaginationImpl |
getDefaultPagination(Type<?> entityClass)
Default Instance.
|
static PaginationImpl |
getDefaultPagination(Type<?> entityClass,
ElideSettings elideSettings)
Default Instance.
|
static PaginationImpl |
parseQueryParams(Type<?> entityClass,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
ElideSettings elideSettings)
Given json-api paging params, generate page and pageSize values from query params.
|
boolean |
returnPageTotals()
Whether or not the client requested to return page totals.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLimit, getOffset, getPageTotals, isDefaultInstance, setPageTotals
public static final String PAGE_NUMBER_KEY
public static final String PAGE_SIZE_KEY
public static final String PAGE_OFFSET_KEY
public static final String PAGE_LIMIT_KEY
public static final String PAGE_TOTALS_KEY
public static final Map<String,PaginationImpl.PaginationKey> PAGE_KEYS
public PaginationImpl(Class<?> entityClass, Integer clientOffset, Integer clientLimit, int systemDefaultLimit, int systemMaxLimit, Boolean generateTotals, Boolean pageByPages)
entityClass
- The type of collection we are paginating.clientOffset
- The client requested offset or null if not provided.clientLimit
- The client requested limit or null if not provided.systemDefaultLimit
- The system default limit (in terms of records).systemMaxLimit
- The system max limit (in terms of records).generateTotals
- Whether to return the total number of records.pageByPages
- Whether to page by pages or records.public PaginationImpl(Type<?> entityClass, Integer clientOffset, Integer clientLimit, int systemDefaultLimit, int systemMaxLimit, Boolean generateTotals, Boolean pageByPages)
entityClass
- The type of collection we are paginating.clientOffset
- The client requested offset or null if not provided.clientLimit
- The client requested limit or null if not provided.systemDefaultLimit
- The system default limit (in terms of records).systemMaxLimit
- The system max limit (in terms of records).generateTotals
- Whether to return the total number of records.pageByPages
- Whether to page by pages or records.public boolean returnPageTotals()
returnPageTotals
in interface Pagination
public static PaginationImpl parseQueryParams(Type<?> entityClass, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, ElideSettings elideSettings) throws InvalidValueException
entityClass
- The collection type.queryParams
- The page queryParams.elideSettings
- Elide settings containing pagination default limitsInvalidValueException
- invalid query parameterpublic static PaginationImpl getDefaultPagination(Type<?> entityClass, ElideSettings elideSettings)
elideSettings
- general Elide settingspublic static PaginationImpl getDefaultPagination(Type<?> entityClass)
Copyright © 2015–2021 Yahoo! Inc.. All rights reserved.