Package tech.ailef.dbadmin.external.dto
Class PaginationInfo
java.lang.Object
tech.ailef.dbadmin.external.dto.PaginationInfo
Attached as output to requests that have a paginated response,
holds information about the current pagination.
-
Constructor Summary
ConstructorsConstructorDescriptionPaginationInfo
(int currentPage, int maxPage, int pageSize, long maxElement, String query, FilterRequest request) -
Method Summary
Modifier and TypeMethodDescriptionReturns the pages after the current oneReturns the pages before the current oneint
Returns the current requested pagegetLink
(int page) Returns a link to the specified page by preserving all the other filtering parameterslong
Returns the total count of elements for all pagesint
Returns the last page for which there are results availableint
Returns the current number of elements per pagegetSortedPageLink
(String sortKey, String sortOrder) Returns a link to the current page by preserving all the other filtering parameters but changing the sort order.boolean
Returns whether the current page is the last onevoid
setCurrentPage
(int currentPage) void
setMaxPage
(int maxPage) void
setPageSize
(int pageSize)
-
Constructor Details
-
PaginationInfo
public PaginationInfo(int currentPage, int maxPage, int pageSize, long maxElement, String query, FilterRequest request)
-
-
Method Details
-
getCurrentPage
public int getCurrentPage()Returns the current requested page -
setCurrentPage
public void setCurrentPage(int currentPage) -
getMaxPage
public int getMaxPage()Returns the last page for which there are results available- Returns:
-
setMaxPage
public void setMaxPage(int maxPage) -
getPageSize
public int getPageSize()Returns the current number of elements per page- Returns:
-
setPageSize
public void setPageSize(int pageSize) -
getMaxElement
public long getMaxElement()Returns the total count of elements for all pages- Returns:
-
getSortedPageLink
Returns a link to the current page by preserving all the other filtering parameters but changing the sort order.- Parameters:
sortKey
- the field to use for sortingsortOrder
- the order, DESC or ASC- Returns:
- a link to change the sort order for the current page
-
getLink
Returns a link to the specified page by preserving all the other filtering parameters- Parameters:
page
- the page to generate the link for- Returns:
-
getBeforePages
Returns the pages before the current one- Returns:
-
getAfterPages
Returns the pages after the current one- Returns:
-
isLastPage
public boolean isLastPage()Returns whether the current page is the last one- Returns:
-