public class PageRequest extends AbstractPageRequest
Pageable
.Modifier | Constructor and Description |
---|---|
protected |
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) |
PageRequest |
first()
Returns the
Pageable requesting the first page. |
Sort |
getSort()
Returns the sorting parameters.
|
int |
hashCode() |
PageRequest |
next()
|
static PageRequest |
of(int page,
int size)
Creates a new unsorted
PageRequest . |
static PageRequest |
of(int page,
int size,
Sort.Direction direction,
String... properties)
Creates a new
PageRequest with sort direction and properties applied. |
static PageRequest |
of(int page,
int size,
Sort sort)
Creates a new
PageRequest with sort parameters applied. |
static PageRequest |
ofSize(int pageSize)
|
PageRequest |
previous()
|
String |
toString() |
PageRequest |
withPage(int pageNumber)
Creates a new
PageRequest with pageNumber applied. |
PageRequest |
withSort(Sort.Direction direction,
String... properties)
|
PageRequest |
withSort(Sort sort)
Creates a new
PageRequest with Sort applied. |
getOffset, getPageNumber, getPageSize, hasPrevious, previousOrFirst
protected PageRequest(int page, int size, Sort sort)
PageRequest
with sort parameters applied.page
- zero-based page index, must not be negative.size
- the size of the page to be returned, must be greater than 0.sort
- must not be null, use Sort.unsorted()
instead.public static PageRequest of(int page, int size)
PageRequest
.page
- zero-based page index, must not be negative.size
- the size of the page to be returned, must be greater than 0.public static PageRequest of(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
- must not be null, use Sort.unsorted()
instead.public static PageRequest of(int page, int size, Sort.Direction direction, String... properties)
PageRequest
with sort direction and properties applied.page
- zero-based page index, must not be negative.size
- the size of the page to be returned, must be greater than 0.direction
- must not be null.properties
- must not be null.public static PageRequest ofSize(int pageSize)
pageSize
- the size of the page to be returned, must be greater than 0.PageRequest
.public Sort getSort()
Pageable
public PageRequest next()
Pageable
next
in interface Pageable
next
in class AbstractPageRequest
public PageRequest previous()
AbstractPageRequest
previous
in class AbstractPageRequest
public PageRequest first()
Pageable
Pageable
requesting the first page.first
in interface Pageable
first
in class AbstractPageRequest
public boolean equals(@Nullable Object obj)
equals
in class AbstractPageRequest
public PageRequest withPage(int pageNumber)
PageRequest
with pageNumber
applied.pageNumber
- PageRequest
.public PageRequest withSort(Sort.Direction direction, String... properties)
direction
- must not be null.properties
- must not be null.PageRequest
.public PageRequest withSort(Sort sort)
PageRequest
with Sort
applied.sort
- must not be null.PageRequest
.public int hashCode()
hashCode
in class AbstractPageRequest
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.