Interface Page<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <S> Page<S>empty()Creates an emptyPage.static <S> Page<S>empty(int number, int size, SortingData sortingData, long totalElements)Creates an emptyPage, using the given paging and sorting information.static <S> Page<S>emptyUnsorted(int number, int size, long totalElements)Creates an empty unsortedPage, using the given paging information.<U> Page<U>map(java.util.function.Function<T,U> mapper)Maps the content of this page according to the givenmapper.static <S> Page<S>of(int number, int size, SortingData sortingData, java.util.List<S> content, long totalElements)Creates aPage.static <S> Page<S>ofUnsorted(int number, int size, java.util.List<S> content, long totalElements)Creates an unsortedPage.longtotalElements()inttotalPages()-
Methods inherited from interface com.bellotapps.webapps_commons.persistence.repository_utils.Slice
content, firstRequest, hasContent, hasNext, hasPrevious, isFirst, isLast, nextRequest, number, numberOfElements, offset, previousRequest, requestedBy, size, sortingData
-
-
-
-
Method Detail
-
totalPages
int totalPages()
- Returns:
- The total amount of pages.
-
totalElements
long totalElements()
- Returns:
- The overall amount of elements.
-
map
<U> Page<U> map(java.util.function.Function<T,U> mapper)
Maps the content of this page according to the givenmapper.
-
empty
static <S> Page<S> empty()
Creates an emptyPage.- Type Parameters:
S- The type of elements in the page.- Returns:
- An empty
Page.
-
emptyUnsorted
static <S> Page<S> emptyUnsorted(int number, int size, long totalElements)
Creates an empty unsortedPage, using the given paging information.- Type Parameters:
S- The type of elements in the page.- Parameters:
number- The number of the page.size- The size of the page.totalElements- The overall amount of elements.- Returns:
- An unsorted empty
Page.
-
empty
static <S> Page<S> empty(int number, int size, SortingData sortingData, long totalElements)
Creates an emptyPage, using the given paging and sorting information.- Type Parameters:
S- The type of elements in the page.- Parameters:
number- The number of the page.size- The size of the page.sortingData- TheSortingDatathat was used to sort contents of this page.totalElements- The overall amount of elements.- Returns:
- An empty
Page.
-
ofUnsorted
static <S> Page<S> ofUnsorted(int number, int size, java.util.List<S> content, long totalElements)
Creates an unsortedPage.- Type Parameters:
S- The type of elements in the page.- Parameters:
number- The number of the page.size- The size of the page.content- The elements in the page.totalElements- The overall amount of elements.- Returns:
- An unsorted
Page.
-
of
static <S> Page<S> of(int number, int size, SortingData sortingData, java.util.List<S> content, long totalElements)
Creates aPage.- Type Parameters:
S- The type of elements in the page.- Parameters:
number- The number of the page.size- The size of the page.sortingData- TheSortingDatathat was used to sort contents of this page.content- The elements in the page.totalElements- The overall amount of elements.- Returns:
- A
Page.
-
-