Interface IPaginator<T>

Type Parameters:
T - the resource type
All Known Implementing Classes:
FilteringPaginator, NonFilteringPaginator, Paginator

public interface IPaginator<T>
Converts a list of REST resources into a PagedObject containing some or all of those resources. Also adds and provides information about the current page, page size, first page, last page, number of pages, and so on. Page numbers use a 0-based index (first page = 0).
Since:
9.6
Author:
Radu Batori
  • Method Details Link icon

    • getPageSize Link icon

      Integer getPageSize()
      Returns:
      the page size (number of resources per page)
    • getPageNumber Link icon

      Integer getPageNumber()
      Returns:
      the index current page number
    • getFirstPage Link icon

      Integer getFirstPage()
      Returns:
      the index of the first page
    • getLastPage Link icon

      Integer getLastPage()
      Returns:
      the index of the last page
    • getPrevPage Link icon

      Integer getPrevPage()
      Returns the index of the previous page. If the current page is also the first page, the index of the previous page equals the index of the first page.
      Returns:
      the index of the previous page.
    • getNextPage Link icon

      Integer getNextPage()
      Returns the index of the next page. If the current page is also the last page, the index of the next page equals the index of the last page.
      Returns:
      the index of the next page
    • getNumberOfItems Link icon

      Integer getNumberOfItems()
      Returns:
      the total number of items (prior to pagination).
    • getNumberOfPages Link icon

      Integer getNumberOfPages()
      Returns:
      the total number of pages (after pagination).
    • hasPrevPage Link icon

      boolean hasPrevPage()
      Returns:
      true if there is a previous page.
    • hasNextPage Link icon

      boolean hasNextPage()
      Returns:
      true if there is a next page.
    • paginateList Link icon

      void paginateList(PagedObject<T> pagedObject)
      Paginates the resources and places them in the provided pagedObject. Also sets pagination-related properties on pagedObject.
      Parameters:
      pagedObject - the resource where the paginated resources are placed