Pageable, java.io.SerializableKeysetPageRequestpublic class PageRequest extends java.lang.Object implements Pageable, java.io.Serializable
Pageable, heavily inspired by Spring Data's PageRequest.| Constructor | Description |
|---|---|
PageRequest(int page,
int pageSize) |
Creates a new
PageRequest for requesting the given page with the given page size. |
PageRequest(int page,
int pageSize,
Sort sort) |
Creates a new
PageRequest with given sorting. |
PageRequest(int page,
int pageSize,
Sort.Direction direction,
java.lang.String... paths) |
Creates a new
PageRequest with a sorting based on the given paths and direction. |
PageRequest(Sort sort,
int offset,
int pageSize) |
Creates a new
PageRequest with given sorting. |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(java.lang.Object o) |
|
Pageable |
first() |
|
int |
getOffset() |
Returns the offset represented by the page number multiplied with the page size.
|
int |
getPageNumber() |
Returns the page to be returned.
|
int |
getPageSize() |
Returns the number of elements per page to be returned.
|
Sort |
getSort() |
Returns the sorting that should be used for pagination.
|
int |
hashCode() |
|
boolean |
hasPrevious() |
Returns whether there is a previous Pageable i.e. if the page number is greater than 0.
|
Pageable |
next() |
|
Pageable |
previous() |
|
Pageable |
previousOrFirst() |
|
java.lang.String |
toString() |
public PageRequest(int page,
int pageSize)
PageRequest for requesting the given page with the given page size.page - The zero based page numberpageSize - The number of elements per pagepublic PageRequest(int page,
int pageSize,
Sort.Direction direction,
java.lang.String... paths)
PageRequest with a sorting based on the given paths and direction.page - The zero based page numberpageSize - The number of elements per pagedirection - The direction to use for the Sort to be specified, may be nullpaths - The paths to sort bypublic PageRequest(int page,
int pageSize,
Sort sort)
PageRequest with given sorting.page - The zero based page numberpageSize - The number of elements per pagesort - The sorting to use for the page, may be nullpublic PageRequest(Sort sort, int offset, int pageSize)
PageRequest with given sorting.sort - The sorting to use for the page, may be nulloffset - The zero based offset numberpageSize - The number of elements per pagepublic Sort getSort()
Pageablepublic int getPageSize()
PageablegetPageSize in interface Pageablepublic int getPageNumber()
PageablegetPageNumber in interface Pageablepublic int getOffset()
Pageablepublic boolean hasPrevious()
PageablehasPrevious in interface Pageablepublic Pageable previousOrFirst()
PageablePage or the first if the current one already is the first one.previousOrFirst in interface Pageablepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2020 Blazebit. All rights reserved.