Package jakarta.data.page
Interface Page<T>
- Type Parameters:
T- the type of elements in this page
- All Superinterfaces:
Iterable<T>,Slice<T>,Streamable<T>
- All Known Subinterfaces:
KeysetAwarePage<T>
A page is a sublist of results. It provides information about its position relative to the entire list.
Repository methods that are declared to return Page or
KeysetAwarePage must raise UnsupportedOperationException if the
database is incapable of counting the total number of results across all pages,
in which case a return type of Slice or KeysetAwareSlice
should be used instead.
-
Method Summary
Modifier and TypeMethodDescriptionlongReturns the total amount of elements.longReturns the total number of pages.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface jakarta.data.page.Slice
content, hasContent, nextPageable, numberOfElements, pageableMethods inherited from interface jakarta.data.Streamable
stream
-
Method Details
-
totalElements
long totalElements()Returns the total amount of elements.- Returns:
- the total amount of elements.
-
totalPages
long totalPages()Returns the total number of pages.- Returns:
- the total number of pages.
-