Class PaginationInfo

java.lang.Object
tech.ailef.dbadmin.external.dto.PaginationInfo

public class PaginationInfo extends Object
Attached as output to requests that have a paginated response, holds information about the current pagination.
  • 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

      public String getSortedPageLink(String sortKey, String sortOrder)
      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 sorting
      sortOrder - the order, DESC or ASC
      Returns:
      a link to change the sort order for the current page
    • getLink

      public String getLink(int page)
      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

      public List<Integer> getBeforePages()
      Returns the pages before the current one
      Returns:
    • getAfterPages

      public List<Integer> getAfterPages()
      Returns the pages after the current one
      Returns:
    • isLastPage

      public boolean isLastPage()
      Returns whether the current page is the last one
      Returns: