Package org.springframework.data.domain
Class PageImpl<T>
java.lang.Object
org.springframework.data.domain.PageImpl<T>
- Type Parameters:
- T- the type of which the page consists.
- All Implemented Interfaces:
- Serializable,- Iterable<T>,- Supplier<Stream<T>>,- Page<T>,- Slice<T>,- Streamable<T>
- Direct Known Subclasses:
- GeoPage
Basic 
Page implementation.- Author:
- Oliver Gierke, Mark Paluch
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns the page content asList.protected <U> List<U>getConvertedContent(Function<? super T, ? extends U> converter) intReturns the number of the currentSlice.intReturns the number of elements currently on thisSlice.intgetSize()Returns the size of theSlice.getSort()Returns the sorting parameters for theSlice.longReturns the total amount of elements.intReturns the number of total pages.booleanReturns whether theSlicehas content at all.inthashCode()booleanhasNext()Returns if there is a nextSlice.booleanReturns if there is a previousSlice.booleanisFirst()Returns whether the currentSliceis the first one.booleanisLast()Returns whether the currentSliceis the last one.iterator()<U> Page<U>toString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, iterator, spliteratorMethods inherited from interface org.springframework.data.domain.SlicegetContent, getNumber, getNumberOfElements, getPageable, getSize, getSort, hasContent, hasPrevious, isFirst, nextOrLastPageable, nextPageable, previousOrFirstPageable, previousPageable
- 
Constructor Details- 
PageImplConstructor ofPageImpl.- Parameters:
- content- the content of this page, must not be null.
- pageable- the paging information, must not be null.
- total- the total amount of items available. The total might be adapted considering the length of the content given, if it is going to be the content of the last page. This is in place to mitigate inconsistencies.
 
- 
PageImplCreates a newPageImplwith the given content. This will result in the createdPagebeing identical to the entireList.- Parameters:
- content- must not be null.
 
 
- 
- 
Method Details- 
getTotalPagespublic int getTotalPages()Description copied from interface:PageReturns the number of total pages.- Specified by:
- getTotalPagesin interface- Page<T>
- Returns:
- the number of total pages
 
- 
getTotalElementspublic long getTotalElements()Description copied from interface:PageReturns the total amount of elements.- Specified by:
- getTotalElementsin interface- Page<T>
- Returns:
- the total amount of elements
 
- 
hasNextpublic boolean hasNext()Description copied from interface:SliceReturns if there is a nextSlice.
- 
isLastpublic boolean isLast()Description copied from interface:SliceReturns whether the currentSliceis the last one.
- 
mapDescription copied from interface:Page
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
- 
getNumberpublic int getNumber()Description copied from interface:SliceReturns the number of the currentSlice. Is always non-negative.
- 
getSizepublic int getSize()Description copied from interface:SliceReturns the size of theSlice.
- 
getNumberOfElementspublic int getNumberOfElements()Description copied from interface:SliceReturns the number of elements currently on thisSlice.- Specified by:
- getNumberOfElementsin interface- Slice<T>
- Returns:
- the number of elements currently on this Slice.
 
- 
hasPreviouspublic boolean hasPrevious()Description copied from interface:SliceReturns if there is a previousSlice.- Specified by:
- hasPreviousin interface- Slice<T>
- Returns:
- if there is a previous Slice.
 
- 
isFirstpublic boolean isFirst()Description copied from interface:SliceReturns whether the currentSliceis the first one.
- 
nextPageableDescription copied from interface:SliceReturns thePageableto request the nextSlice. Can bePageable.unpaged()in case the currentSliceis already the last one. Clients should checkSlice.hasNext()before calling this method.- Specified by:
- nextPageablein interface- Slice<T>
- Returns:
- See Also:
 
- 
previousPageableDescription copied from interface:SliceReturns thePageableto request the previousSlice. Can bePageable.unpaged()in case the currentSliceis already the first one. Clients should checkSlice.hasPrevious()before calling this method.- Specified by:
- previousPageablein interface- Slice<T>
- Returns:
- See Also:
 
- 
hasContentpublic boolean hasContent()Description copied from interface:SliceReturns whether theSlicehas content at all.- Specified by:
- hasContentin interface- Slice<T>
- Returns:
 
- 
getContentDescription copied from interface:SliceReturns the page content asList.- Specified by:
- getContentin interface- Slice<T>
- Returns:
 
- 
getPageableDescription copied from interface:Slice- Specified by:
- getPageablein interface- Slice<T>
- Returns:
 
- 
getSortDescription copied from interface:SliceReturns the sorting parameters for theSlice.
- 
iterator
- 
getConvertedContent- Parameters:
- converter- must not be null.
- Returns:
 
 
-