Class PageImpl<T>
- java.lang.Object
-
- com.bellotapps.webapps_commons.persistence.repository_utils.AbstractSlice<T>
-
- com.bellotapps.webapps_commons.persistence.repository_utils.PageImpl<T>
-
public class PageImpl<T> extends AbstractSlice<T> implements Page<T>
Concrete implementation ofPage.
-
-
Constructor Summary
Constructors Constructor Description PageImpl(int number, int size, SortingData sortingData, java.util.List<T> content, long totalElements)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Indicates whether this is the last slice.<U> Page<U>map(java.util.function.Function<T,U> mapper)Maps the content of this page according to the givenmapper.longtotalElements()inttotalPages()-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.bellotapps.webapps_commons.persistence.repository_utils.Slice
content, firstRequest, hasContent, hasPrevious, isFirst, isLast, nextRequest, number, numberOfElements, offset, previousRequest, requestedBy, size, sortingData
-
-
-
-
Constructor Detail
-
PageImpl
public PageImpl(int number, int size, SortingData sortingData, java.util.List<T> content, long totalElements)Constructor.- Parameters:
number- Number of slice.size- Slice size.sortingData- TheSortingDatathat was used to sort contents of this slice.content- Content in this slice.totalElements- The overall amount of elements.
-
-
Method Detail
-
totalPages
public int totalPages()
- Specified by:
totalPagesin interfacePage<T>- Returns:
- The total amount of pages.
-
totalElements
public long totalElements()
- Specified by:
totalElementsin interfacePage<T>- Returns:
- The overall amount of elements.
-
hasNext
public boolean hasNext()
Description copied from interface:SliceIndicates whether this is the last slice.
-
-