Interface PaginationContext
-
public interface PaginationContextDescribes the requested pagination parameters for aHttpServletRequest. The values encoded in the request's query string (QUERY_FIELDS) are extracted from theHttpServletRequestand represented by this object.- Author:
- cdivilly
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePaginationContext.BuilderBuildPaginationContextinstances
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringITEM_OFFSETThe zero based offset of the first item to appear in the pagestatic java.lang.StringLIMITThe requested maximum number of items in the page.static java.lang.StringPAGE_OFFSETThe zero based offset of the pagestatic java.util.List<java.lang.String>QUERY_FIELDSThe reserved names of query string fields used byPagination.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longitemOffset()The zero based index offset of the first item to appear in the pagelonglimit()The requested maximum number of items in the page.PaginationContext.Buildermodify()Modify thisPaginationContextlongpageOffset()The zero based page offset
-
-
-
Field Detail
-
ITEM_OFFSET
static final java.lang.String ITEM_OFFSET
The zero based offset of the first item to appear in the page- See Also:
- Constant Field Values
-
LIMIT
static final java.lang.String LIMIT
The requested maximum number of items in the page.- See Also:
- Constant Field Values
-
PAGE_OFFSET
static final java.lang.String PAGE_OFFSET
The zero based offset of the page- See Also:
- Constant Field Values
-
QUERY_FIELDS
static final java.util.List<java.lang.String> QUERY_FIELDS
The reserved names of query string fields used byPagination.
-
-
Method Detail
-
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
-
-