class AwaitingWriteOperationIterable<T,W> extends java.lang.Object implements MongoIterable<T>
Modifier and Type | Field and Description |
---|---|
private java.util.List<SingleResultCallback<java.lang.Void>> |
callbacks |
private MongoIterable<T> |
delegated |
private java.lang.Throwable |
thrown |
private boolean |
writeCompleted |
Constructor and Description |
---|
AwaitingWriteOperationIterable(AsyncWriteOperation<W> writeOperation,
AsyncOperationExecutor executor,
MongoIterable<T> delegated) |
Modifier and Type | Method and Description |
---|---|
void |
batchCursor(SingleResultCallback<AsyncBatchCursor<T>> callback)
Provide the underlying
AsyncBatchCursor allowing fine grained control of the cursor. |
AwaitingWriteOperationIterable<T,W> |
batchSize(int batchSize)
Sets the number of documents to return per batch.
|
void |
first(SingleResultCallback<T> callback)
Helper to return the first item in the iterator or null.
|
void |
forEach(Block<? super T> block,
SingleResultCallback<java.lang.Void> callback)
Iterates over all documents in the view, applying the given block to each, and completing the returned future after all documents
have been iterated, or an exception has occurred.
|
<A extends java.util.Collection<? super T>> |
into(A target,
SingleResultCallback<A> callback)
Iterates over all the documents, adding each to the given target.
|
<U> MongoIterable<U> |
map(Function<T,U> mapper)
Maps this iterable from the source document type to the target document type.
|
private final MongoIterable<T> delegated
private final java.util.List<SingleResultCallback<java.lang.Void>> callbacks
private boolean writeCompleted
private java.lang.Throwable thrown
AwaitingWriteOperationIterable(AsyncWriteOperation<W> writeOperation, AsyncOperationExecutor executor, MongoIterable<T> delegated)
public void first(SingleResultCallback<T> callback)
MongoIterable
first
in interface MongoIterable<T>
callback
- a callback that is passed the first item or null.public void forEach(Block<? super T> block, SingleResultCallback<java.lang.Void> callback)
MongoIterable
forEach
in interface MongoIterable<T>
block
- the block to apply to each documentcallback
- a callback that completed once the iteration has completedpublic <A extends java.util.Collection<? super T>> void into(A target, SingleResultCallback<A> callback)
MongoIterable
into
in interface MongoIterable<T>
A
- the collection typetarget
- the collection to insert intocallback
- a callback that will be passed the target containing all documentspublic <U> MongoIterable<U> map(Function<T,U> mapper)
MongoIterable
map
in interface MongoIterable<T>
U
- the target document typemapper
- a function that maps from the source to the target document typepublic AwaitingWriteOperationIterable<T,W> batchSize(int batchSize)
MongoIterable
batchSize
in interface MongoIterable<T>
batchSize
- the batch sizepublic void batchCursor(SingleResultCallback<AsyncBatchCursor<T>> callback)
MongoIterable
AsyncBatchCursor
allowing fine grained control of the cursor.batchCursor
in interface MongoIterable<T>
callback
- a callback that will be passed the AsyncBatchCursor