org.springframework.data.domain

## Interface Page<T>

Type Parameters:
  `T` -

All Superinterfaces:
  Iterable<T>, Slice<T>, Streamable<T>, Supplier<Stream<T>>

All Known Implementing Classes:
  GeoPage, PageImpl

    public interface Page<T>
    extends Slice<T>

A page is a sublist of a list of objects. It allows gain information about the position of it in the containing entire list.

Author:
  Oliver Gierke

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Default Methods
`static <T> Page<T>` `empty()` Creates a new empty `Page`.
`static <T> Page<T>` `empty(Pageable pageable)` Creates a new empty `Page` for the given `Pageable`.
`long` `getTotalElements()` Returns the total amount of elements.
`int` `getTotalPages()` Returns the number of total pages.
`<U> Page<U>` `map(Function<? super T,? extends U> converter)` Returns a new `Page` with the content of the current one mapped by the given `Function`.

### Methods inherited from interface org.springframework.data.domain.Slice

`getContent, getNumber, getNumberOfElements, getPageable, getSize, getSort, hasContent, hasNext, hasPrevious, isFirst, isLast, nextOrLastPageable, nextPageable, previousOrFirstPageable, previousPageable`

### Methods inherited from interface org.springframework.data.util.Streamable

`and, and, and, and, filter, flatMap, get, isEmpty, of, of, of, stream, toList, toSet, toStreamable, toStreamable`

### Methods inherited from interface java.lang.Iterable

`forEach, iterator, spliterator`

### Method Detail

#### empty

    static <T> Page<T> empty()

Creates a new empty `Page`.

Specified by:
  `empty` in interface `Streamable<T>`
Returns:
Since:
  2.0

#### empty

    static <T> Page<T> empty(Pageable pageable)

Creates a new empty `Page` for the given `Pageable`.

Parameters:
  `pageable` - must not be null.
Returns:
Since:
  2.0

#### getTotalPages

    int getTotalPages()

Returns the number of total pages.

Returns:
  the number of total pages

#### getTotalElements

    long getTotalElements()

Returns the total amount of elements.

Returns:
  the total amount of elements

#### map

    <U> Page<U> map(Function<? super T,? extends U> converter)

Returns a new `Page` with the content of the current one mapped by the given `Function`.

Specified by:
  `map` in interface `Slice<T>`
Specified by:
  `map` in interface `Streamable<T>`
Parameters:
  `converter` - must not be null.
Returns:
  a new `Page` with the content of the current one mapped by the given `Function`.
Since:
  1.10
See Also:
  `Stream.map(Function)`