Interface ResultPacker<T>
- Type Parameters:
T- the type of object resulting from the packing
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionFetches a single instance from the givenResultSet, assumingResultSet.next()has been calledIterates through the givenResultSet, packing its contents into aListusingget(ResultSet)in the order they appear.
-
Method Details
-
pack
Iterates through the givenResultSet, packing its contents into aListusingget(ResultSet)in the order they appear. This method does not close theResultSet.- Parameters:
resultSet- theResultSetinstance containing the query result to process- Returns:
- an unmodifiable
Listcontaining the data from the query result - Throws:
SQLException- thrown if anything goes wrong during the packingNullPointerException- in caseresultSetis null
-
get
Fetches a single instance from the givenResultSet, assumingResultSet.next()has been called- Parameters:
resultSet- theResultSet- Returns:
- the instance fetched from the
ResultSet - Throws:
SQLException- in case of failure
-