Interface Pagination<T>

All Superinterfaces:
PageModelEntity

public interface Pagination<T> extends PageModelEntity
Base class for Pagination implementations.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the current page
    Gets the first page
    Gets the items listed on the page
    Gets the last page
    int
    Gets the number of pages which are shown on the pagination
    Gets the next page
    int
    Gets the offset with respect to the current page number.
    Returns pages with respect to the limit
    Gets the previous page
    int
    Gets the size of items which are listed on the page.
    long
    Total number of results
    boolean
    Whether pagination is enabled
  • Method Details

    • getItems

      List<T> 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

      List<Page> getPages()
      Returns pages with respect to the limit
      Returns:
      List containing page numbers