final class ListDatabasesIterableImpl<TResult> extends java.lang.Object implements ListDatabasesIterable<TResult>
| Modifier and Type | Field and Description |
|---|---|
private CodecRegistry |
codecRegistry |
private OperationExecutor |
executor |
private long |
maxTimeMS |
private ReadPreference |
readPreference |
private java.lang.Class<TResult> |
resultClass |
| Constructor and Description |
|---|
ListDatabasesIterableImpl(java.lang.Class<TResult> resultClass,
CodecRegistry codecRegistry,
ReadPreference readPreference,
OperationExecutor executor) |
| Modifier and Type | Method and Description |
|---|---|
ListDatabasesIterable<TResult> |
batchSize(int batchSize)
Sets the number of documents to return per batch.
|
private ListDatabasesOperation<TResult> |
createListCollectionsOperation() |
private MongoIterable<TResult> |
execute() |
TResult |
first()
Helper to return the first item in the iterator or null.
|
void |
forEach(Block<? super TResult> block)
Iterates over all documents in the view, applying the given block to each.
|
<A extends java.util.Collection<? super TResult>> |
into(A target)
Iterates over all the documents, adding each to the given target.
|
MongoCursor<TResult> |
iterator() |
<U> MongoIterable<U> |
map(Function<TResult,U> mapper)
Maps this iterable from the source document type to the target document type.
|
ListDatabasesIterableImpl<TResult> |
maxTime(long maxTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
private final java.lang.Class<TResult> resultClass
private final ReadPreference readPreference
private final CodecRegistry codecRegistry
private final OperationExecutor executor
private long maxTimeMS
ListDatabasesIterableImpl(java.lang.Class<TResult> resultClass, CodecRegistry codecRegistry, ReadPreference readPreference, OperationExecutor executor)
public ListDatabasesIterableImpl<TResult> maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
ListDatabasesIterablemaxTime in interface ListDatabasesIterable<TResult>maxTime - the max timetimeUnit - the time unit, which may not be nullpublic MongoCursor<TResult> iterator()
iterator in interface MongoIterable<TResult>iterator in interface java.lang.Iterable<TResult>public TResult first()
MongoIterablefirst in interface MongoIterable<TResult>public <U> MongoIterable<U> map(Function<TResult,U> mapper)
MongoIterablemap in interface MongoIterable<TResult>U - the target document typemapper - a function that maps from the source to the target document typepublic void forEach(Block<? super TResult> block)
MongoIterableSimilar to map but the function is fully encapsulated with no returned result.
forEach in interface MongoIterable<TResult>block - the block to apply to each document of type T.public <A extends java.util.Collection<? super TResult>> A into(A target)
MongoIterableinto in interface MongoIterable<TResult>A - the collection typetarget - the collection to insert intopublic ListDatabasesIterable<TResult> batchSize(int batchSize)
ListDatabasesIterablebatchSize in interface ListDatabasesIterable<TResult>batchSize in interface MongoIterable<TResult>batchSize - the batch sizeprivate MongoIterable<TResult> execute()
private ListDatabasesOperation<TResult> createListCollectionsOperation()