Class Pager

  • All Implemented Interfaces:
    java.lang.Iterable

    
    public class Pager<T extends JsonSerializable>
    extends BasePager<T> implements Iterable<T>
                        

    Pager class for iterating through paginated results.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      ImmutableList<T> nextPage() Fetches the next page of items.
      Iterator<T> iterator() Returns an iterator for the Pager.
      String name() Returns the name of the item for this pager.
      int pageSize() Returns the page size for this pager.
      int size() Returns the size of the current page.
      ImmutableList<T> page() Returns the current page of items as a list.
      Optional<HttpResponse> sdkHttpResponse() Returns an Optional of the HttpResponse for the current page, which can be used to get the http headers.
      • Methods inherited from class java.lang.Iterable

        forEach, spliterator
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • nextPage

         ImmutableList<T> nextPage()

        Fetches the next page of items. This makes a new API request.

      • name

         String name()

        Returns the name of the item for this pager.

      • pageSize

         int pageSize()

        Returns the page size for this pager.

      • size

         int size()

        Returns the size of the current page.

      • page

         ImmutableList<T> page()

        Returns the current page of items as a list.