Package io.micronaut.data.model
Interface Page<T>
- Type Parameters:
- T- The generic type
@DefaultImplementation(io.micronaut.data.model.DefaultPage.class)
public interface Page<T>
extends Slice<T>
Inspired by the Spring Data's 
Page and GORM's PagedResultList, this models a type that supports
 pagination operations.
 A Page is a result set associated with a particular Pageable that includes a calculation of the total
 size of number of records.
- Since:
- 1.0.0
- Author:
- graemerocher
- 
Field SummaryFields
- 
Method SummaryMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface io.micronaut.data.model.SlicegetContent, getNumberOfElements, getOffset, getPageable, getPageNumber, getSize, getSort, isEmpty, iterator, nextPageable, previousPageable
- 
Field Details- 
EMPTY
 
- 
- 
Method Details- 
getTotalSizelong getTotalSize()- Returns:
- The total size of the all records.
 
- 
getTotalPagesdefault int getTotalPages()- Returns:
- The total number of pages
 
- 
mapMaps the content with the given function.
- 
of@NonNull static <T> @NonNull Page<T> of(@NonNull @NonNull List<T> content, @NonNull @NonNull Pageable pageable, long totalSize) Creates a slice from the given content and pageable.- Type Parameters:
- T- The generic type
- Parameters:
- content- The content
- pageable- The pageable
- totalSize- The total size
- Returns:
- The slice
 
- 
emptyCreates an empty page object.- Type Parameters:
- T2- The generic type
- Returns:
- The slice
 
 
-