Class StreamingResultSetHandler<T>
- java.lang.Object
-
- dev.aherscu.qa.jgiven.jdbc.utils.dbutils.StreamingResultSetHandler<T>
-
- Type Parameters:
T
- the target Stream generic type
- All Implemented Interfaces:
org.apache.commons.dbutils.ResultSetHandler<Stream<T>>
- Direct Known Subclasses:
ArrayStreamingHandler
,BeanStreamingHandler
,MapStreamingHandler
public abstract class StreamingResultSetHandler<T> extends Object implements org.apache.commons.dbutils.ResultSetHandler<Stream<T>>
Abstract class that simplifies the development of ResultSetHandler classes that convert ResultSets into Streams.- See Also:
ResultSetHandler
-
-
Constructor Summary
Constructors Constructor Description StreamingResultSetHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Stream<T>
handle(ResultSet resultSet)
Whole ResultSet handler.protected abstract T
handleRow(ResultSet rs)
Row handler.
-
-
-
Method Detail
-
handle
public Stream<T> handle(ResultSet resultSet) throws SQLException
Whole ResultSet handler. It produces a Stream as the result. To convert individual rows into Java objects it uses the handleRow(ResultSet) method.- Specified by:
handle
in interfaceorg.apache.commons.dbutils.ResultSetHandler<T>
- Parameters:
resultSet
- The ResultSet to process.- Returns:
- a Stream of all rows in the result set, each row converted to T
- Throws:
SQLException
- error occurs- See Also:
handleRow(ResultSet)
-
handleRow
protected abstract T handleRow(ResultSet rs) throws SQLException
Row handler. Method converts current row into some Java object.- Parameters:
rs
- ResultSet to process.- Returns:
- row processing result
- Throws:
SQLException
- error occurs
-
-