Constructor and Description |
---|
PagerBeanUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
computeRecordIndexesAndPagesNumber(PagerBean bean)
Given a pagerBean, compute his
PagerBean.recordStartIndex ,
PagerBean.recordEndIndex and PagerBean.pagesNumber . |
static <E> List<E> |
getPage(List<E> elements,
int page,
int pageSize)
Get the elements of the lists using the pager datas:
elements :all elements of the pager
pageSize : number of elements in a page
page : the requested page number starting at 1
|
static org.apache.commons.lang3.tuple.Pair<Long,Long> |
getPageBound(long totalCount,
int page,
int pageSize)
Compute the pager bound given his datas:
totalCount : count of all elements of the pager
pageSize : number of elements in a page
page : the requested page number starting at 1
|
static long |
getTotalPage(long totalCount,
int pageSize)
Given a total count of elements and a page size, compute the number of
pages available.
|
static PagerBean |
newPagerBean() |
public static long getTotalPage(long totalCount, int pageSize)
totalCount
- total count of elements in the pagerpageSize
- size of a pagepublic static org.apache.commons.lang3.tuple.Pair<Long,Long> getPageBound(long totalCount, int page, int pageSize)
totalCount
: count of all elements of the pagerpageSize
: number of elements in a pagepage
: the requested page number starting at 1
totalCount
- total count of elements in the pagerpage
- pager page number (starting at 1
)pageSize
- number of elements in a pagepublic static <E> List<E> getPage(List<E> elements, int page, int pageSize)
elements
:all elements of the pagerpageSize
: number of elements in a pagepage
: the requested page number starting at 1
E
- n'importe quel typeelements
- all pager elementspage
- pager page number (starting at 1
)pageSize
- number of elements in a pagepublic static void computeRecordIndexesAndPagesNumber(PagerBean bean)
PagerBean.recordStartIndex
,
PagerBean.recordEndIndex
and PagerBean.pagesNumber
.bean
- the pagerBean to fillpublic static PagerBean newPagerBean()
Copyright © 2004–2022 Code Lutin. All rights reserved.