Class QPageRequest
java.lang.Object
org.springframework.data.domain.AbstractPageRequest
org.springframework.data.querydsl.QPageRequest
- All Implemented Interfaces:
Serializable,Pageable
Basic Java Bean implementation of
Pageable with support for QueryDSL.- Author:
- Thomas Darimont, Oliver Drotbohm, Mark Paluch, Thach Le
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfirst()Returns thePageablerequesting the first page.getSort()Returns the sorting parameters.next()static QPageRequestof(int pageNumber, int pageSize) Creates a newQPageRequest.static QPageRequestof(int pageNumber, int pageSize, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Creates a newQPageRequestwith the givenOrderSpecifiers applied.static QPageRequestCreates a newQPageRequestwith sort parameters applied.static QPageRequestofSize(int pageSize) previous()withPage(int pageNumber) Creates a newQPageRequestwithpageNumberapplied.Creates a newQPageRequestwithQSortapplied.Methods inherited from class org.springframework.data.domain.AbstractPageRequest
equals, getOffset, getPageNumber, getPageSize, hashCode, hasPrevious, previousOrFirstMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.domain.Pageable
getSortOr, isPaged, isUnpaged, toLimit, toOptional, toScrollPosition
-
Method Details
-
of
Creates a newQPageRequest. Pages are zero indexed, thus providing 0 forpageNumberwill return the first pageNumber.- Parameters:
pageNumber- zero-based page number, must not be negative.pageSize- the size of the page to be returned, must be greater than 0.- Since:
- 2.1
-
of
public static QPageRequest of(int pageNumber, int pageSize, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers) Creates a newQPageRequestwith the givenOrderSpecifiers applied.- Parameters:
pageNumber- zero-based page number, must not be negative.pageSize- the size of the page to be returned, must be greater than 0.orderSpecifiers- must not be null or empty;- Since:
- 2.1
-
of
Creates a newQPageRequestwith sort parameters applied.- Parameters:
pageNumber- zero-based page number, must not be negative.pageSize- the size of the page to be returned, must be greater than 0.sort- must not be null.- Since:
- 2.1
-
ofSize
- Parameters:
pageSize- the size of the page to be returned, must be greater than 0.- Returns:
- a new
QPageRequest. - Since:
- 2.5
-
getSort
Description copied from interface:PageableReturns the sorting parameters.- Returns:
- the sorting order.
-
next
Description copied from interface:Pageable -
previous
Description copied from class:AbstractPageRequest- Specified by:
previousin classAbstractPageRequest- Returns:
- the previous
Pageable
-
first
Description copied from interface:PageableReturns thePageablerequesting the first page.- Specified by:
firstin interfacePageable- Specified by:
firstin classAbstractPageRequest- Returns:
- the
Pageablerequesting the first page.
-
withPage
Creates a newQPageRequestwithpageNumberapplied.- Parameters:
pageNumber-- Returns:
- a new
PageRequest. - Since:
- 2.5
-
withSort
Creates a newQPageRequestwithQSortapplied.- Parameters:
sort- must not be null.- Returns:
- a new
PageRequest. - Since:
- 2.5
-