Class PageRequest

java.lang.Object
com.e1c.langtool.history.db.pagination.PageRequest
All Implemented Interfaces:
IPageable

public final class PageRequest extends Object implements IPageable
The basic implementation of Pageable.
  • Method Details

    • first

      public static PageRequest first(int size)
      Creates a new PageRequest requesting the first page. This PageRequest has number equals to 1.
      Parameters:
      size - the size of page
      Returns:
      a new page request
      Throws:
      IllegalArgumentException - if the page number < 1 or page size < 0
    • of

      public static PageRequest of(int number, int size)
      Creates a new PageRequest.
      Parameters:
      number - the one-based number of page
      size - the size of page
      Returns:
      a new page request
      Throws:
      IllegalArgumentException - if the page number < 1 or page size < 0
    • getNumber

      public int getNumber()
      Description copied from interface: IPageable
      Returns the number of page.
      Specified by:
      getNumber in interface IPageable
      Returns:
      the number of page
    • getSize

      public int getSize()
      Description copied from interface: IPageable
      Returns the size of page.
      Specified by:
      getSize in interface IPageable
      Returns:
      the size of page
    • getNext

      public IPageable getNext()
      Description copied from interface: IPageable
      Returns the IPageable requesting the next page.
      Specified by:
      getNext in interface IPageable
      Returns:
      the pageable requesting the next page
    • getPrevious

      public IPageable getPrevious()
      Description copied from interface: IPageable
      Returns the IPageable requesting the previous or first page if this IPageable already is the first one.
      Specified by:
      getPrevious in interface IPageable
      Returns:
      the pageable requesting the previous or first page