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 Details

    • empty

      static <T> Page<T> empty()
      Creates a new empty Page.
      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: