Class AbstractPagedResult<T>
- java.lang.Object
-
- org.fugerit.java.core.log.BasicLogObject
-
- org.fugerit.java.core.util.result.BasicResult
-
- org.fugerit.java.core.util.result.AbstractPagedResult<T>
-
- All Implemented Interfaces:
LogObject
,PagedResult<T>
,Result
- Direct Known Subclasses:
DefaultPagedResult
public abstract class AbstractPagedResult<T> extends BasicResult implements PagedResult<T>
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_SUPPORT_VIRTUAL_PAGING
-
Fields inherited from class org.fugerit.java.core.util.result.BasicResult
DEFAULT_KO_RESULT, DEFAULT_OK_RESULT
-
Fields inherited from interface org.fugerit.java.core.util.result.PagedResult
ELEMENT_COUNT_UNAVAILABLE, FIRST_PAGE_INDEX
-
Fields inherited from interface org.fugerit.java.core.util.result.Result
RESULT_CODE_KO, RESULT_CODE_OK
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPagedResult()
protected
AbstractPagedResult(int perPage, long elementCount, int currentPage, int pageCount, List<T> pageElements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getCurrentPage()
Position of current page ( in the range 1 - n )Integer
getCurrentPageSize()
Number of elements in current pageLong
getElementCount()
Total number of elements in all pagesMap<String,Object>
getInfo()
Additional info of this page.Integer
getOffset()
The position of the first element of the current pages ( (currentPage-1) * perPage )Integer
getPageCount()
Total number of pagesIterator<Integer>
getPageCountIterator()
Iterator over page numbers ( 1 - n )Iterator<T>
getPageElements()
Elements in the current pageList<T>
getPageElementsList()
Elements in the current pageInteger
getPerPage()
Maximum number of elements in a pageboolean
isFirstPage()
true
if this is the last page.boolean
isLastPage()
true
if this is the last page.boolean
isSupportVirtualPaging()
-
Methods inherited from class org.fugerit.java.core.util.result.BasicResult
getInfoMap, getResultCode, isResultOk, setResultCode, toString
-
Methods inherited from class org.fugerit.java.core.log.BasicLogObject
getLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.fugerit.java.core.util.result.PagedResult
getRealCurrentPage, getRealPerPage, getVirtualPage, getVirtualSearchKey, isFullResult
-
Methods inherited from interface org.fugerit.java.core.util.result.Result
getInfoMap, getResultCode, isResultOk, setResultCode
-
-
-
-
Field Detail
-
DEFAULT_SUPPORT_VIRTUAL_PAGING
public static final boolean DEFAULT_SUPPORT_VIRTUAL_PAGING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getOffset
public Integer getOffset()
Description copied from interface:PagedResult
The position of the first element of the current pages ( (currentPage-1) * perPage )
- Specified by:
getOffset
in interfacePagedResult<T>
- Returns:
- offset of the first element in this page
-
getPerPage
public Integer getPerPage()
Description copied from interface:PagedResult
Maximum number of elements in a page
- Specified by:
getPerPage
in interfacePagedResult<T>
- Returns:
- maximum number of elements in a page
-
getElementCount
public Long getElementCount()
Description copied from interface:PagedResult
Total number of elements in all pages
- Specified by:
getElementCount
in interfacePagedResult<T>
- Returns:
- total number of elements in all pages
-
getCurrentPage
public Integer getCurrentPage()
Description copied from interface:PagedResult
Position of current page ( in the range 1 - n )
- Specified by:
getCurrentPage
in interfacePagedResult<T>
- Returns:
- position of current page
-
getPageCount
public Integer getPageCount()
Description copied from interface:PagedResult
Total number of pages
- Specified by:
getPageCount
in interfacePagedResult<T>
- Returns:
- total number of pages
-
getCurrentPageSize
public Integer getCurrentPageSize()
Description copied from interface:PagedResult
Number of elements in current page
- Specified by:
getCurrentPageSize
in interfacePagedResult<T>
- Returns:
- the size of the current page
-
getPageElements
public Iterator<T> getPageElements()
Description copied from interface:PagedResult
Elements in the current page
- Specified by:
getPageElements
in interfacePagedResult<T>
- Returns:
- elements in the current page
-
getPageElementsList
public List<T> getPageElementsList()
Description copied from interface:PagedResult
Elements in the current page
- Specified by:
getPageElementsList
in interfacePagedResult<T>
- Returns:
- elements in the current page
-
getPageCountIterator
public Iterator<Integer> getPageCountIterator()
Description copied from interface:PagedResult
Iterator over page numbers ( 1 - n )
- Specified by:
getPageCountIterator
in interfacePagedResult<T>
- Returns:
- iterator over page numbers ( 1 - n )
-
getInfo
public Map<String,Object> getInfo()
Description copied from interface:PagedResult
Additional info of this page.- Specified by:
getInfo
in interfacePagedResult<T>
- Returns:
- info
-
isLastPage
public boolean isLastPage()
Description copied from interface:PagedResult
true
if this is the last page.- Specified by:
isLastPage
in interfacePagedResult<T>
- Returns:
true
if it's the last page
-
isFirstPage
public boolean isFirstPage()
Description copied from interface:PagedResult
true
if this is the last page.- Specified by:
isFirstPage
in interfacePagedResult<T>
- Returns:
true
if it's the first page
-
isSupportVirtualPaging
public boolean isSupportVirtualPaging()
- Specified by:
isSupportVirtualPaging
in interfacePagedResult<T>
-
-