Interface ReactiveResultSetExtractor<T>
- All Known Implementing Classes:
ReactiveRowMapperResultSetExtractor
- 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
ReactiveCqlTemplate
's query methods. Implementations of this interface perform the
actual work of extracting results from a ReactiveResultSet
, but don't need to worry about exception handling.
DriverException
s will be caught and handled by the calling ReactiveCqlTemplate
.
This interface is mainly used within the CQL framework itself. A RowMapper
is usually a simpler choice for
ReactiveResultSet
processing, mapping one result object per row instead of one result object for the entire
ReactiveResultSet
.
Note: ReactiveResultSetExtractor
object is typically stateless and thus reusable, as long as it doesn't
access stateful resources or keep result state within the object.
- Since:
- 2.0
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<T>
extractData
(ReactiveResultSet resultSet) Implementations must implement this method to process the entireReactiveResultSet
.
-
Method Details
-
extractData
org.reactivestreams.Publisher<T> extractData(ReactiveResultSet resultSet) throws com.datastax.oss.driver.api.core.DriverException, DataAccessException Implementations must implement this method to process the entireReactiveResultSet
.- Parameters:
resultSet
-ReactiveResultSet
to extract data from, must not be null.- Returns:
- an arbitrary result object
Publisher
. - Throws:
com.datastax.oss.driver.api.core.DriverException
- if aDriverException
is encountered getting column values or navigating (that is, there's no need to catchDriverException
).DataAccessException
- in case of custom exceptions.
-