public class QueryResultStreamAdapter extends Object implements QueryResultStream
QueryResultStream
, wrapping a ResultStream
of EventQueryResultEntry
. Defers
calls to the given resultStream
, adapting them to a QueryResult
.Constructor and Description |
---|
QueryResultStreamAdapter(io.axoniq.axonserver.connector.ResultStream<io.axoniq.axonserver.connector.event.EventQueryResultEntry> resultStream)
Construct a
QueryResultStreamAdapter deferring calls to the given resultStream . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
hasNext(int timeout,
TimeUnit unit)
Validates whether there is a following entry in this stream to consume.
|
QueryResult |
next()
Returns the following
QueryResult from this stream. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasNext
forEachRemaining, remove
public QueryResultStreamAdapter(io.axoniq.axonserver.connector.ResultStream<io.axoniq.axonserver.connector.event.EventQueryResultEntry> resultStream)
QueryResultStreamAdapter
deferring calls to the given resultStream
.resultStream
- the stream of EventQueryResultEntry
to adapt to QueryResult
instancespublic boolean hasNext(int timeout, TimeUnit unit)
QueryResultStream
timeout
with the
given unit
to wait to respondhasNext
in interface QueryResultStream
true
if there is another entry, false
if there isn't for at the given durationpublic QueryResult next()
QueryResultStream
QueryResult
from this stream. Might return null
if nothing is presentnext
in interface Iterator<QueryResult>
next
in interface QueryResultStream
QueryResult
from this streampublic void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2010–2023. All rights reserved.