Class PaginationAction.PaginationIterator<E>

  • All Implemented Interfaces:
    java.util.Iterator<E>
    Enclosing interface:
    PaginationAction<T,​M extends PaginationAction<T,​M>>

    public static class PaginationAction.PaginationIterator<E>
    extends java.lang.Object
    implements java.util.Iterator<E>
    Iterator implementation for a PaginationAction.
    This iterator will first iterate over all currently cached entities and continue to retrieve new entities as needed.

    To retrieve new entities after reaching the end of the current cache, this iterator will request a List of new entities through a call of RestAction.complete().
    It is recommended to use the highest possible limit for this task. (see PaginationAction.limit(int))

    • Constructor Summary

      Constructors 
      Constructor Description
      PaginationIterator​(java.util.Collection<E> queue, java.util.function.Supplier<java.util.List<E>> supply)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      E next()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
    • Constructor Detail

      • PaginationIterator

        public PaginationIterator​(java.util.Collection<E> queue,
                                  java.util.function.Supplier<java.util.List<E>> supply)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<E>
      • next

        public E next()
        Specified by:
        next in interface java.util.Iterator<E>