Interface PageRequest

  • All Known Implementing Classes:
    PageRequestImpl

    public interface PageRequest
    Abstract interface for pagination information. See Spring Data Commons, but more flat design and independent of Spring libraries.
    • Method Detail

      • getPageNumber

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

        int getPageSize()
        Returns the number of items to be returned.
        Returns:
        the number of items of that page
      • getOffset

        int getOffset()
        Returns the offset to be taken according to the underlying page and page size.
        Returns:
        the offset to be taken
      • getSorting

        Sorting getSorting()
        Returns the sorting parameters.
        Returns:
        the sorting parameters
      • next

        PageRequest next()
        Returns the PageRequest requesting the next page.
        Returns:
        the PageRequest requesting the next page
      • previousOrFirst

        PageRequest previousOrFirst()
        Returns the previous PageRequest or the first PageRequest if the current one already is the first one.
        Returns:
        the previous PageRequest or the first PageRequest if the current one already is the first one
      • first

        PageRequest first()
        Returns the PageRequest requesting the first page.
        Returns:
        the PageRequest requesting the first page
      • hasPrevious

        boolean hasPrevious()
        Returns whether there's a previous PageRequest we can access from the current one. Will return false in case the current PageRequest already refers to the first page.
        Returns:
        whether there's a previous PageRequest
      • setPageSize

        void setPageSize​(int pageSize)
        Sets the number of items.
        Parameters:
        pageSize - the number of items of that page
      • setSorting

        void setSorting​(Sorting sorting)
        Sets the sorting parameters.
        Parameters:
        sorting - the sorting parameters