Interface RemoteMongoIterable<ResultT>
-
- Type Parameters:
ResultT- The type that this iterable will decode documents to.
- All Superinterfaces:
Iterable<ResultT>
- All Known Subinterfaces:
RemoteAggregateIterable<ResultT>,RemoteFindIterable<ResultT>
- All Known Implementing Classes:
RemoteAggregateIterableImpl,RemoteFindIterableImpl,RemoteMongoIterableImpl
public interface RemoteMongoIterable<ResultT> extends Iterable<ResultT>
The RemoteMongoIterable is the results from an operation, such as a query.
-
-
Method Summary
Modifier and Type Method Description ResultTfirst()Helper to return the first item in the iterator or null.voidforEach(Block<? super ResultT> block)Iterates over all documents in the view, applying the given block to each.<A extends Collection<? super ResultT>>
Ainto(A target)Iterates over all the documents, adding each to the given target.RemoteMongoCursor<ResultT>iterator()Returns a cursor of the operation represented by this iterable.<U> RemoteMongoIterable<U>map(Function<ResultT,U> mapper)Maps this iterable from the source document type to the target document type.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
iterator
@Nonnull RemoteMongoCursor<ResultT> iterator()
Returns a cursor of the operation represented by this iterable.
-
first
@Nullable ResultT first()
Helper to return the first item in the iterator or null.- Returns:
- T the first item or null.
-
map
<U> RemoteMongoIterable<U> map(Function<ResultT,U> mapper)
Maps this iterable from the source document type to the target document type.- Type Parameters:
U- the target document type- Parameters:
mapper- a function that maps from the source to the target document type- Returns:
- an iterable which maps T to U
-
forEach
void forEach(Block<? super ResultT> block)
Iterates over all documents in the view, applying the given block to each.Similar to
mapbut the function is fully encapsulated with no returned result.- Parameters:
block- the block to apply to each document of type T.
-
into
<A extends Collection<? super ResultT>> A into(A target)
Iterates over all the documents, adding each to the given target.- Type Parameters:
A- the collection type- Parameters:
target- the collection to insert into- Returns:
- the target
-
-