Interface Pagination<T>
- All Superinterfaces:
PageModelEntity
Base class for Pagination implementations.
-
Method Summary
Modifier and TypeMethodDescriptionGets the current pagegetFirst()
Gets the first pagegetItems()
Gets the items listed on the pagegetLast()
Gets the last pageint
getLimit()
Gets the number of pages which are shown on the paginationgetNext()
Gets the next pageint
Gets the offset with respect to the current page number.getPages()
Returns pages with respect to the limitGets the previous pageint
getSize()
Gets the size of items which are listed on the page.long
getTotal()
Total number of resultsboolean
Whether pagination is enabled
-
Method Details
-
getItems
Gets the items listed on the page -
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.
-
getPages
Returns pages with respect to the limit- Returns:
- List containing page numbers
-