Package com.fauna.event
Class FeedIterator<E>
- java.lang.Object
-
- com.fauna.event.FeedIterator<E>
-
-
Constructor Summary
Constructors Constructor Description FeedIterator(FaunaClient client, EventSource eventSource, FeedOptions feedOptions, java.lang.Class<E> resultClass)Construct a new PageIterator.
-
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.booleanhasNext()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).
-
-
-
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:
hasNextin interfacejava.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:
nextin interfacejava.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.
-
-