Package org.springframework.data.domain
Class AbstractPageRequest
java.lang.Object
org.springframework.data.domain.AbstractPageRequest
- All Implemented Interfaces:
- Serializable,- Pageable
- Direct Known Subclasses:
- PageRequest,- QPageRequest
Abstract Java Bean implementation of 
Pageable.- Author:
- Thomas Darimont, Oliver Gierke, Alex Bondarev, Johannes Englmeier, Thach Le
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractPageRequest(int pageNumber, int pageSize) Creates a newAbstractPageRequest.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanabstract Pageablefirst()Returns thePageablerequesting the first page.longReturns the offset to be taken according to the underlying page and page size.intReturns the page to be returned.intReturns the number of items to be returned.inthashCode()booleanReturns whether there's a previousPageablewe can access from the current one.abstract Pageablenext()abstract Pageableprevious()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.domain.PageablegetSort, getSortOr, isPaged, isUnpaged, toLimit, toOptional, toScrollPosition, withPage
- 
Constructor Details- 
AbstractPageRequestpublic AbstractPageRequest(int pageNumber, int pageSize) Creates a newAbstractPageRequest. 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.
 
 
- 
- 
Method Details- 
getPageSizepublic int getPageSize()Description copied from interface:PageableReturns the number of items to be returned.- Specified by:
- getPageSizein interface- Pageable
- Returns:
- the number of items of that page or throws UnsupportedOperationExceptionif the object isPageable.isUnpaged().
 
- 
getPageNumberpublic int getPageNumber()Description copied from interface:PageableReturns the page to be returned.- Specified by:
- getPageNumberin interface- Pageable
- Returns:
- the page to be returned or throws UnsupportedOperationExceptionif the object isPageable.isUnpaged().
 
- 
getOffsetpublic long getOffset()Description copied from interface:PageableReturns the offset to be taken according to the underlying page and page size.- Specified by:
- getOffsetin interface- Pageable
- Returns:
- the offset to be taken or throws UnsupportedOperationExceptionif the object isPageable.isUnpaged().
 
- 
hasPreviouspublic boolean hasPrevious()Description copied from interface:PageableReturns whether there's a previousPageablewe can access from the current one. Will return false in case the currentPageablealready refers to the first page.- Specified by:
- hasPreviousin interface- Pageable
- Returns:
 
- 
previousOrFirstDescription copied from interface:Pageable- Specified by:
- previousOrFirstin interface- Pageable
- Returns:
 
- 
nextDescription copied from interface:Pageable
- 
previous- Returns:
 
- 
firstDescription copied from interface:PageableReturns thePageablerequesting the first page.
- 
hashCodepublic int hashCode()
- 
equals
 
-