Interface Pagination<T>
-
- All Superinterfaces:
PageModelEntity
public interface Pagination<T> extends PageModelEntity
Base class for Pagination implementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Page
getCurrent()
Gets the current pagePage
getFirst()
Gets the first pageList<T>
getItems()
Gets the items listed on the pagePage
getLast()
Gets the last pageint
getLimit()
Gets the number of pages which are shown on the paginationPage
getNext()
Gets the next pageint
getOffset()
Gets the offset with respect to the current page number.List<Page>
getPages()
Returns pages with respect to the limitPage
getPrevious()
Gets the previous pageint
getSize()
Gets the size of items which are listed on the page.long
getTotal()
Total number of resultsboolean
isEnabled()
Whether pagination is enabled
-
-
-
Method Detail
-
getFirst
Page getFirst()
Gets the first page- Returns:
-
getPrevious
Page getPrevious()
Gets the previous page- Returns:
- the previous page if there is any. Otherwise returns null.
-
getCurrent
Page getCurrent()
Gets the current page- Returns:
-
getNext
Page getNext()
Gets the next page- Returns:
- the next page if there is any. Otherwise returns null.
-
getLast
Page getLast()
Gets the last page- Returns:
-
getSize
int getSize()
Gets the size of items which are listed on the page.- Returns:
-
getLimit
int getLimit()
Gets the number of pages which are shown on the pagination- Returns:
-
getTotal
long getTotal()
Total number of results- Returns:
-
isEnabled
boolean isEnabled()
Whether pagination is enabled- Returns:
- true if the pagination is enabled
-
getOffset
int getOffset()
Gets the offset with respect to the current page number.- Returns:
- calculates and returns the start offset. If the calculated value is greater or equal to total number of results, returns 0.
-
-