java.lang.Object
com.amazonaws.services.dynamodbv2.document.Page<T,R>
Type Parameters:
T - item type
R - low level result type
All Implemented Interfaces:
Iterable<T>

public abstract class Page<T,R> extends Object implements Iterable<T>
A page contains a list of items; accessing methods on the list are guaranteed to be purely in-memory operations that will not block or throw exceptions because of transient network issues. A page also knows whether it has a "next page", and if so knows how to retrieve it (which will almost certainly involve a remote network call that may block or fail).
  • Constructor Details

    • Page

      public Page(List<T> content, R lowLevelResult)
      Parameters:
      content - an unmodifiable list of content
      lowLevelResult - the low level (response) result from AWSS
  • Method Details

    • hasNextPage

      public abstract boolean hasNextPage()
      Checks whether this page has a "next page." If this method returns true, the next page can be retrieved by calling next. If it returns false, any call to next will be guaranteed to throw an IllegalStateException.
      Returns:
      true if there is next page; false otherwise
    • nextPage

      public abstract Page<T,R> nextPage()
      Retrieves the next page.
      Returns:
      the next page
      Throws:
      NoSuchElementException - if there is no next page
      AmazonServiceException - on error making the remote call
    • size

      public final int size()
    • iterator

      public final Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLowLevelResult

      public final R getLowLevelResult()