Class FeedIterator<E>

  • Type Parameters:
    E -
    All Implemented Interfaces:
    java.util.Iterator<FeedPage<E>>

    public final class FeedIterator<E>
    extends java.lang.Object
    implements java.util.Iterator<FeedPage<E>>
    FeedIterator iterates over Event Feed pages from Fauna.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<FaunaEvent<E>> flatten()
      Return an iterator that iterates directly over the items that make up the page contents.
      boolean hasNext()  
      FeedPage<E> next()
      Get the next Page (synchronously).
      java.util.concurrent.CompletableFuture<FeedPage<E>> nextAsync()
      Returns a CompletableFuture that will complete with the next page (or throw a FaunaException).
      • Methods inherited from class java.lang.Object

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

        forEachRemaining, remove
    • Constructor Detail

      • FeedIterator

        public FeedIterator​(FaunaClient client,
                            EventSource eventSource,
                            FeedOptions feedOptions,
                            java.lang.Class<E> resultClass)
        Construct a new PageIterator.
        Parameters:
        client - A client that makes requests to Fauna.
        eventSource - The Fauna Event Source.
        feedOptions - The FeedOptions object.
        resultClass - The class of the elements returned from Fauna (i.e. the rows).
    • Method Detail

      • hasNext

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

        public java.util.concurrent.CompletableFuture<FeedPage<E>> nextAsync()
        Returns a CompletableFuture that will complete with the next page (or throw a FaunaException). When the future completes, the next page will be fetched in the background.
        Returns:
        A CompletableFuture that completes with a new FeedPage instance.
      • next

        public FeedPage<E> next()
        Get the next Page (synchronously).
        Specified by:
        next in interface java.util.Iterator<E>
        Returns:
        FeedPage The next Page of elements E.
        Throws:
        FaunaException - If there is an error getting the next page.
      • flatten

        public java.util.Iterator<FaunaEvent<E>> flatten()
        Return an iterator that iterates directly over the items that make up the page contents.
        Returns:
        An iterator of E.