Interface Pageable

  • All Known Subinterfaces:
    KeysetPageable
    All Known Implementing Classes:
    KeysetPageRequest, PageRequest

    public interface Pageable
    Interface containing pagination information, heavily inspired by Spring Data's Pageable.
    Since:
    1.2.0
    Author:
    Christian Beikov
    • Method Detail

      • getPageNumber

        int getPageNumber()
        Returns the page to be returned. Zero based.
        Returns:
        The page to be returned.
      • getPageSize

        int getPageSize()
        Returns the number of elements per page to be returned.
        Returns:
        The number of elements per page
      • getOffset

        int getOffset()
        Returns the offset represented by the page number multiplied with the page size.
        Returns:
        The offset
      • getSort

        Sort getSort()
        Returns the sorting that should be used for pagination.
        Returns:
        The sorting
      • previous

        Pageable previous()
        Returns the Pageable that can be used to request the previous Page or null if the current one already is the first one.
        Returns:
        The Pageable for the previous Page
      • previousOrFirst

        Pageable previousOrFirst()
        Returns the Pageable that can be used to request the previous Page or the first if the current one already is the first one.
        Returns:
        The Pageable for the previous or first Page
      • hasPrevious

        boolean hasPrevious()
        Returns whether there is a previous Pageable i.e. if the page number is greater than 0.
        Returns:
        Whether there is a previous page