public class SliceImpl<T> extends Object
Slice
.Constructor and Description |
---|
SliceImpl(List<T> content)
Creates a new
SliceImpl with the given content. |
SliceImpl(List<T> content,
Pageable pageable,
boolean hasNext)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
List<T> |
getContent()
Returns the page content as
List . |
protected <U> List<U> |
getConvertedContent(Function<? super T,? extends U> converter)
|
int |
getNumber()
Returns the number of the current
Slice . |
int |
getNumberOfElements()
Returns the number of elements currently on this
Slice . |
Pageable |
getPageable()
|
int |
getSize()
Returns the size of the
Slice . |
Sort |
getSort()
Returns the sorting parameters for the
Slice . |
boolean |
hasContent()
Returns whether the
Slice has content at all. |
int |
hashCode() |
boolean |
hasNext()
Returns if there is a next
Slice . |
boolean |
hasPrevious()
Returns if there is a previous
Slice . |
boolean |
isFirst()
Returns whether the current
Slice is the first one. |
boolean |
isLast()
Returns whether the current
Slice is the last one. |
Iterator<T> |
iterator() |
<U> Slice<U> |
map(Function<? super T,? extends U> converter)
|
Pageable |
nextPageable()
|
Pageable |
previousPageable()
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
and, empty, filter, flatMap, get, isEmpty, of, of, of, stream
forEach, spliterator
public SliceImpl(List<T> content, Pageable pageable, boolean hasNext)
content
- the content of this Slice
, must not be null.pageable
- the paging information, must not be null.hasNext
- whether there's another slice following the current one.public boolean hasNext()
Slice
Slice
.Slice
.public <U> Slice<U> map(Function<? super T,? extends U> converter)
Slice
converter
- must not be null.Slice
with the content of the current one mapped by the given Converter
.Stream.map(Function)
public int hashCode()
public int getNumber()
Slice
Slice
. Is always non-negative.public int getSize()
Slice
Slice
.public int getNumberOfElements()
Slice
Slice
.getNumberOfElements
in interface Slice<T>
Slice
.public boolean hasPrevious()
Slice
Slice
.hasPrevious
in interface Slice<T>
Slice
.public boolean isFirst()
Slice
Slice
is the first one.public boolean isLast()
Slice
Slice
is the last one.public Pageable nextPageable()
Slice
Pageable
to request the next Slice
. Can be Pageable.unpaged()
in case the
current Slice
is already the last one. Clients should check Slice.hasNext()
before calling this method.nextPageable
in interface Slice<T>
public Pageable previousPageable()
Slice
Pageable
to request the previous Slice
. Can be Pageable.unpaged()
in case the
current Slice
is already the first one. Clients should check Slice.hasPrevious()
before calling this
method.previousPageable
in interface Slice<T>
public boolean hasContent()
Slice
Slice
has content at all.hasContent
in interface Slice<T>
public List<T> getContent()
Slice
List
.getContent
in interface Slice<T>
public Sort getSort()
Slice
Slice
.protected <U> List<U> getConvertedContent(Function<? super T,? extends U> converter)
converter
- must not be null.public Pageable getPageable()
Slice
getPageable
in interface Slice<T>
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.