org.synyx.hades.domain
Class PageRequest

java.lang.Object
  extended by org.synyx.hades.domain.PageRequest
All Implemented Interfaces:
Pageable

public class PageRequest
extends java.lang.Object
implements Pageable

Basic Java Bean implementation of Pageable.

Author:
Oliver Gierke

Constructor Summary
PageRequest(int page, int size)
          Creates a new PageRequest.
PageRequest(int page, int size, Order order, java.lang.String... properties)
          Creates a new PageRequest with sort parameters applied.
PageRequest(int page, int size, Sort sort)
          Creates a new PageRequest with sort parameters applied.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getFirstItem()
          Returns the first item relatively to the total number of items.
 int getPageNumber()
          Returns the page to be returned.
 int getPageSize()
          Returns the number of items to be returned.
 Sort getSort()
          Returns the sorting parameters.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageRequest

public PageRequest(int page,
                   int size)
Creates a new PageRequest. Pages are zero indexed, thus providing 0 for page will return the first page.

Parameters:
size -
page -

PageRequest

public PageRequest(int page,
                   int size,
                   Order order,
                   java.lang.String... properties)
Creates a new PageRequest with sort parameters applied.

Parameters:
page -
size -
order -
properties -

PageRequest

public PageRequest(int page,
                   int size,
                   Sort sort)
Creates a new PageRequest with sort parameters applied.

Parameters:
page -
size -
sort -
Method Detail

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.

getFirstItem

public int getFirstItem()
Description copied from interface: Pageable
Returns the first item relatively to the total number of items.

Specified by:
getFirstItem in interface Pageable
Returns:
the first item to be returned

getSort

public Sort getSort()
Description copied from interface: Pageable
Returns the sorting parameters.

Specified by:
getSort in interface Pageable
Returns:

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2009-2010 Synyx GmbH & Co. KG. All Rights Reserved.