Class QueryResultStreamAdapter
java.lang.Object
org.axonframework.axonserver.connector.event.axon.QueryResultStreamAdapter
- All Implemented Interfaces:
AutoCloseable,Iterator<QueryResult>,QueryResultStream
Adapter for the
QueryResultStream, wrapping a ResultStream of EventQueryResultEntry. Defers
calls to the given resultStream, adapting them to a QueryResult.- Since:
- 4.5.2
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionQueryResultStreamAdapter(io.axoniq.axonserver.connector.ResultStream<io.axoniq.axonserver.connector.event.EventQueryResultEntry> resultStream) Construct aQueryResultStreamAdapterdeferring calls to the givenresultStream. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, removeMethods inherited from interface org.axonframework.axonserver.connector.event.axon.QueryResultStream
hasNext
-
Constructor Details
-
QueryResultStreamAdapter
public QueryResultStreamAdapter(io.axoniq.axonserver.connector.ResultStream<io.axoniq.axonserver.connector.event.EventQueryResultEntry> resultStream) Construct aQueryResultStreamAdapterdeferring calls to the givenresultStream.- Parameters:
resultStream- the stream ofEventQueryResultEntryto adapt toQueryResultinstances
-
-
Method Details
-
hasNext
Description copied from interface:QueryResultStreamValidates whether there is a following entry in this stream to consume. Uses the giventimeoutwith the givenunitto wait to respond- Specified by:
hasNextin interfaceQueryResultStream- Returns:
trueif there is another entry,falseif there isn't for at the given duration
-
next
Description copied from interface:QueryResultStreamReturns the followingQueryResultfrom this stream. Might returnnullif nothing is present- Specified by:
nextin interfaceIterator<QueryResult>- Specified by:
nextin interfaceQueryResultStream- Returns:
- the following
QueryResultfrom this stream
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-