Class AbstractPageRequest

java.lang.Object
org.springframework.data.domain.AbstractPageRequest
All Implemented Interfaces:
Serializable, Pageable
Direct Known Subclasses:
PageRequest, QPageRequest

public abstract class AbstractPageRequest extends Object implements Pageable, Serializable
Abstract Java Bean implementation of Pageable.
Author:
Thomas Darimont, Oliver Gierke, Alex Bondarev
See Also:
  • Constructor Details

    • AbstractPageRequest

      public AbstractPageRequest(int page, int size)
      Creates a new AbstractPageRequest. Pages are zero indexed, thus providing 0 for page will return the first page.
      Parameters:
      page - must not be less than zero.
      size - must not be less than one.
  • Method Details

    • getPageSize

      public int getPageSize()
      Description copied from interface: Pageable
      Returns the number of items to be returned.
      Specified by:
      getPageSize in interface Pageable
      Returns:
      the number of items of that page
    • getPageNumber

      public int getPageNumber()
      Description copied from interface: Pageable
      Returns the page to be returned.
      Specified by:
      getPageNumber in interface Pageable
      Returns:
      the page to be returned.
    • getOffset

      public long getOffset()
      Description copied from interface: Pageable
      Returns the offset to be taken according to the underlying page and page size.
      Specified by:
      getOffset in interface Pageable
      Returns:
      the offset to be taken
    • hasPrevious

      public boolean hasPrevious()
      Description copied from interface: Pageable
      Returns whether there's a previous Pageable we can access from the current one. Will return false in case the current Pageable already refers to the first page.
      Specified by:
      hasPrevious in interface Pageable
      Returns:
    • previousOrFirst

      public Pageable previousOrFirst()
      Description copied from interface: Pageable
      Returns the previous Pageable or the first Pageable if the current one already is the first one.
      Specified by:
      previousOrFirst in interface Pageable
      Returns:
    • next

      public abstract Pageable next()
      Description copied from interface: Pageable
      Returns the Pageable requesting the next Page.
      Specified by:
      next in interface Pageable
      Returns:
    • previous

      public abstract Pageable previous()
      Returns the Pageable requesting the previous Page.
      Returns:
    • first

      public abstract Pageable first()
      Description copied from interface: Pageable
      Returns the Pageable requesting the first page.
      Specified by:
      first in interface Pageable
      Returns:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object