public class PageRequest extends Object implements Pageable, Serializable
Pageable.| Constructor and Description |
|---|
PageRequest(int page,
int size)
Creates a new
PageRequest. |
PageRequest(int page,
int size,
Sort.Direction direction,
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. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Pageable |
first()
Returns the
Pageable requesting the first page. |
int |
getOffset()
Returns the offset to be taken according to the underlying page and page size.
|
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() |
boolean |
hasPrevious()
Returns whether there's a previous
Pageable we can access from the current one. |
Pageable |
next()
|
Pageable |
previousOrFirst()
|
String |
toString() |
public PageRequest(int page,
int size)
PageRequest. Pages are zero indexed, thus providing 0 for page will return the first
page.page - zero-based page index.size - the size of the page to be returned.public PageRequest(int page,
int size,
Sort.Direction direction,
String... properties)
PageRequest with sort parameters applied.page - zero-based page index.size - the size of the page to be returned.direction - the direction of the Sort to be specified, can be null.properties - the properties to sort by, must not be null or empty.public PageRequest(int page,
int size,
Sort sort)
PageRequest with sort parameters applied.page - zero-based page index.size - the size of the page to be returned.sort - can be null.public int getPageSize()
PageablegetPageSize in interface Pageablepublic int getPageNumber()
PageablegetPageNumber in interface Pageablepublic int getOffset()
Pageablepublic Sort getSort()
Pageablepublic boolean hasPrevious()
PageablePageable we can access from the current one. Will return
false in case the current Pageable already refers to the first page.hasPrevious in interface Pageablepublic Pageable previousOrFirst()
PageablepreviousOrFirst in interface Pageablepublic Pageable first()
PageablePageable requesting the first page.Copyright © 2011-2013-2014 Pivotal. All Rights Reserved.