Package no.digipost.jdbc
Interface NullableColumnMapper<R>
- Type Parameters:
R- The type of theOptionalresult.
- All Superinterfaces:
ColumnMapper<Optional<R>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A
ColumnMapper which is apropriate for retrieving nullable columns
from a ResultSet. If the result from a mapping (or any Function in the mapping chain)
is null, the result is always Optional.empty(), and the chain of any remaining
mapping functions are "short-circuited" and not invoked.-
Method Summary
Modifier and TypeMethodDescriptiondefault <S> NullableColumnMapper<S>Create a newNullableColumnMapperwhich will map the result of this one using the givenfunction.static <R> NullableColumnMapper<R>of(ThrowingBiFunction<String, ResultSet, R, ? extends SQLException> function) Methods inherited from interface no.digipost.jdbc.ColumnMapper
forColumn, map
-
Method Details
-
of
static <R> NullableColumnMapper<R> of(ThrowingBiFunction<String, ResultSet, R, ? extends SQLException> function) -
andThen
Create a newNullableColumnMapperwhich will map the result of this one using the givenfunction.- Type Parameters:
S- The type ofOptional<S>the new mapper yields from aResultSet- Parameters:
mapper- the mapping function. This will not be called if the result of the mapping chain is alreadyOptional.empty().- Returns:
- the new mapper
-