Interface AsyncResultSetExtractor<T>
- All Known Implementing Classes:
AsyncCqlTemplate.AsyncRowCallbackHandlerResultSetExtractor,AsyncRowMapperResultSetExtractor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback interface used by
AsyncCqlTemplate's query methods. Implementations of this interface perform the
actual work of extracting results from a AsyncResultSet, but don't need to worry about exception handling.
DriverExceptions will be caught and handled by the calling AsyncCqlTemplate.
This interface is mainly used within the CQL framework itself. A RowMapper is usually a simpler choice for
AsyncResultSet processing, mapping one result object per row instead of one result object for the entire
AsyncResultSet.
Note: In contrast to a RowCallbackHandler, a AsyncResultSetExtractor object is typically stateless
and thus reusable, as long as it doesn't access stateful resources or keep result state within the object.
- Since:
- 3.0
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionextractData(com.datastax.oss.driver.api.core.cql.AsyncResultSet resultSet) Implementations must implement this method to process the entireAsyncResultSet.
-
Method Details
-
extractData
CompletableFuture<T> extractData(com.datastax.oss.driver.api.core.cql.AsyncResultSet resultSet) throws com.datastax.oss.driver.api.core.DriverException, DataAccessException Implementations must implement this method to process the entireAsyncResultSet.- Parameters:
resultSet-AsyncResultSetto extract data from.- Returns:
- an arbitrary result object, or null if none (the extractor will typically be stateful in the latter case).
- Throws:
com.datastax.oss.driver.api.core.DriverException- if aDriverExceptionis encountered getting column values or navigating (that is, there's no need to catchDriverException)DataAccessException- in case of custom exceptions
-