class MappingAsyncBatchCursor<T,U> extends java.lang.Object implements AsyncBatchCursor<U>
| Modifier and Type | Field and Description |
|---|---|
private AsyncBatchCursor<T> |
batchCursor |
private Function<T,U> |
mapper |
| Constructor and Description |
|---|
MappingAsyncBatchCursor(AsyncBatchCursor<T> batchCursor,
Function<T,U> mapper) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getBatchSize()
Gets the batch size to use when requesting the next batch.
|
boolean |
isClosed()
Return true if the AsyncBatchCursor has been closed
|
void |
next(SingleResultCallback<java.util.List<U>> callback)
Returns the next batch of results.
|
void |
setBatchSize(int batchSize)
Sets the batch size to use when requesting the next batch.
|
private final AsyncBatchCursor<T> batchCursor
MappingAsyncBatchCursor(AsyncBatchCursor<T> batchCursor, Function<T,U> mapper)
public void next(SingleResultCallback<java.util.List<U>> callback)
AsyncBatchCursornext in interface AsyncBatchCursor<U>callback - callback to receive the next batch of resultspublic void setBatchSize(int batchSize)
AsyncBatchCursorsetBatchSize in interface AsyncBatchCursor<U>batchSize - the non-negative batch size. 0 means to use the server default.public int getBatchSize()
AsyncBatchCursorgetBatchSize in interface AsyncBatchCursor<U>public boolean isClosed()
AsyncBatchCursorisClosed in interface AsyncBatchCursor<U>public void close()
close in interface AsyncBatchCursor<U>close in interface java.io.Closeableclose in interface java.lang.AutoCloseable