Interface PaginationContext
public interface PaginationContext
Describes the requested pagination parameters for a
HttpServletRequest. The values encoded in the request's query string
(QUERY_FIELDS) are extracted from the HttpServletRequest and
represented by this object.- Author:
- cdivilly
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe zero based offset of the first item to appear in the pagestatic final StringThe requested maximum number of items in the page.static final StringThe zero based offset of the pageThe reserved names of query string fields used byPagination. -
Method Summary
Modifier and TypeMethodDescriptionlongThe zero based index offset of the first item to appear in the pagelonglimit()The requested maximum number of items in the page.modify()Modify thisPaginationContextlongThe zero based page offset
-
Field Details
-
ITEM_OFFSET
The zero based offset of the first item to appear in the page- See Also:
-
LIMIT
The requested maximum number of items in the page.- See Also:
-
PAGE_OFFSET
The zero based offset of the page- See Also:
-
QUERY_FIELDS
The reserved names of query string fields used byPagination.
-
-
Method Details
-
itemOffset
long itemOffset()The zero based index offset of the first item to appear in the page- Returns:
- the index or -1 if no item offset was specified in the request
-
limit
long limit()The requested maximum number of items in the page. Note this value will be clamped to be no greater than thePagination.maximumLimit()value.- Returns:
- the requested maximum number of items, or -1 if no limit was specified.
-
modify
PaginationContext.Builder modify()Modify thisPaginationContext- Returns:
PaginationContext.Builderinstance
-
pageOffset
long pageOffset()The zero based page offset- Returns:
- the page offset or -1 if no page offset was specified in the request
-