Class SliceImpl<T>
- java.lang.Object
-
- com.bellotapps.webapps_commons.persistence.repository_utils.AbstractSlice<T>
-
- com.bellotapps.webapps_commons.persistence.repository_utils.SliceImpl<T>
-
- All Implemented Interfaces:
Slice<T>
public class SliceImpl<T> extends AbstractSlice<T>
A concrete implementation of aSlice.
-
-
Constructor Summary
Constructors Constructor Description SliceImpl(int number, int size, SortingData sortingData, java.util.List<T> content, boolean hasNext)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Indicates whether this is the last slice.<U> Slice<U>map(java.util.function.Function<T,U> mapper)Maps the content of this slice according to the givenmapper.-
Methods inherited from class com.bellotapps.webapps_commons.persistence.repository_utils.AbstractSlice
content, firstRequest, hasContent, hasPrevious, isFirst, isLast, nextRequest, number, numberOfElements, offset, previousRequest, requestedBy, size, sortingData
-
-
-
-
Constructor Detail
-
SliceImpl
public SliceImpl(int number, int size, SortingData sortingData, java.util.List<T> content, boolean hasNext)Constructor.- Parameters:
number- Number of slice.size- Slice size.sortingData- TheSortingDatathat was used to sort contents of this slice.content- Content in this slice.hasNext- A flag indicating whether there is another slice.
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from interface:SliceIndicates whether this is the last slice.- Returns:
trueif it is the last slice, orfalseotherwise.
-
map
public <U> Slice<U> map(java.util.function.Function<T,U> mapper)
Description copied from interface:SliceMaps the content of this slice according to the givenmapper.- Type Parameters:
U- Concrete type of the resulting contents.- Parameters:
mapper- AFunctionthat maps the contents of this slice.- Returns:
- A new slice containing the mapped elements.
-
-