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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the page content asList
.protected <U> List
<U> getConvertedContent
(Function<? super T, ? extends U> converter) int
Returns the number of the currentSlice
.int
Returns the number of elements currently on thisSlice
.int
getSize()
Returns the size of theSlice
.getSort()
Returns the sorting parameters for theSlice
.long
Returns the total amount of elements.int
Returns the number of total pages.boolean
Returns whether theSlice
has content at all.int
hashCode()
boolean
hasNext()
Returns if there is a nextSlice
.boolean
Returns if there is a previousSlice
.boolean
isFirst()
Returns whether the currentSlice
is the first one.boolean
isLast()
Returns whether the currentSlice
is the last one.iterator()
<U> Page
<U> toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.springframework.data.domain.Slice
getContent, getNumber, getNumberOfElements, getPageable, getSize, getSort, hasContent, hasPrevious, isFirst, nextOrLastPageable, nextPageable, previousOrFirstPageable, previousPageable
-
Constructor Details
-
PageImpl
Constructor 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.
-
PageImpl
-
-
Method Details
-
getTotalPages
public int getTotalPages()Description copied from interface:Page
Returns the number of total pages.- Specified by:
getTotalPages
in interfacePage<T>
- Returns:
- the number of total pages
-
getTotalElements
public long getTotalElements()Description copied from interface:Page
Returns the total amount of elements.- Specified by:
getTotalElements
in interfacePage<T>
- Returns:
- the total amount of elements
-
hasNext
-
isLast
-
map
Description copied from interface:Slice
-
equals
-
hashCode
public int hashCode() -
toString
-
getNumber
-
getSize
-
getNumberOfElements
-
hasPrevious
-
isFirst
-
nextPageable
Description copied from interface:Slice
Returns thePageable
to request the nextSlice
. Can bePageable.unpaged()
in case the currentSlice
is already the last one. Clients should checkSlice.hasNext()
before calling this method.- Specified by:
nextPageable
in interfaceSlice<T>
- Returns:
- the
Pageable
to request the nextSlice
. - See Also:
-
previousPageable
Description copied from interface:Slice
Returns thePageable
to request the previousSlice
. Can bePageable.unpaged()
in case the currentSlice
is already the first one. Clients should checkSlice.hasPrevious()
before calling this method.- Specified by:
previousPageable
in interfaceSlice<T>
- Returns:
- the
Pageable
to request the previousSlice
. - See Also:
-
hasContent
-
getContent
-
getPageable
-
getSort
-
iterator
-
getConvertedContent
-