T
- The generic typepublic interface Slice<T>
extends java.lang.Iterable<T>
Slice
and GORM's PagedResultList
, this models a type that supports
pagination operations.
A slice is a result list associated with a particular Pageable
Modifier and Type | Method and Description |
---|---|
java.util.List<T> |
getContent() |
default int |
getNumberOfElements() |
default long |
getOffset() |
Pageable |
getPageable() |
default int |
getPageNumber() |
default int |
getSize() |
default Sort |
getSort() |
default boolean |
isEmpty() |
default java.util.Iterator<T> |
iterator() |
default <T2> Slice<T2> |
map(java.util.function.Function<T,T2> function)
Maps the content with the given function.
|
default Pageable |
nextPageable() |
static <T2> Slice<T2> |
of(java.util.List<T2> content,
Pageable pageable)
Creates a slice from the given content and pageable.
|
default Pageable |
previousPageable() |
@NonNull java.util.List<T> getContent()
@NonNull Pageable getPageable()
default int getPageNumber()
@NonNull default Pageable nextPageable()
@NonNull default Pageable previousPageable()
default long getOffset()
default int getSize()
default boolean isEmpty()
@NonNull default Sort getSort()
default int getNumberOfElements()
@NonNull default java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
@Nonnull default <T2> Slice<T2> map(java.util.function.Function<T,T2> function)
T2
- The type returned by the functionfunction
- The function to apply to each element in the content.