public class PageRequestImpl extends Object implements PageRequest, Serializable
PageRequest.
See Spring Data Commons, but more flat design and independent of Spring libraries.| Constructor and Description |
|---|
PageRequestImpl() |
PageRequestImpl(int page,
int size)
Creates a new
PageRequest. |
PageRequestImpl(int page,
int size,
Direction direction,
String... properties)
Creates a new
PageRequest with sort parameters applied. |
PageRequestImpl(int page,
int size,
Sorting sort)
Creates a new
PageRequest with sort parameters applied. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
PageRequest |
first()
Returns the
PageRequest 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.
|
Sorting |
getSorting()
Returns the sorting parameters.
|
int |
hashCode() |
boolean |
hasPrevious()
Returns whether there's a previous
PageRequest we can access from the current one. |
PageRequest |
next()
Returns the
PageRequest requesting the next page. |
PageRequest |
previous()
Returns the
PageResponse requesting the previous page. |
PageRequest |
previousOrFirst()
Returns the previous
PageRequest or the first PageRequest if the current one already is the first one. |
void |
setPageNumber(int page) |
void |
setPageSize(int size) |
void |
setSorting(Sorting sort) |
String |
toString() |
public PageRequestImpl()
public PageRequestImpl(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 PageRequestImpl(int page,
int size,
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 SortingImpl to be specified, can be null.properties - the properties to sort by, must not be null or empty.public PageRequestImpl(int page,
int size,
Sorting sort)
PageRequest with sort parameters applied.page - zero-based page index, must not be less than zero.size - the size of the page to be returned, must not be less than one.sort - can be null.public void setPageNumber(int page)
public void setPageSize(int size)
public void setSorting(Sorting sort)
public PageRequest first()
PageRequestPageRequest requesting the first page.first in interface PageRequestpublic int getOffset()
PageRequestgetOffset in interface PageRequestpublic int getPageNumber()
PageRequestgetPageNumber in interface PageRequestpublic int getPageSize()
PageRequestgetPageSize in interface PageRequestpublic Sorting getSorting()
PageRequestgetSorting in interface PageRequestpublic boolean hasPrevious()
PageRequestPageRequest we can access from the current one. Will return
false in case the current PageRequest already refers to the first page.hasPrevious in interface PageRequestpublic PageRequest next()
PageRequestPageRequest requesting the next page.next in interface PageRequestpublic PageRequest previous()
PageResponse requesting the previous page.public PageRequest previousOrFirst()
PageRequestPageRequest or the first PageRequest if the current one already is the first one.previousOrFirst in interface PageRequestCopyright © 2018. All rights reserved.