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.
@FunctionalInterface public interface NullableColumnMapper<R> extends ColumnMapper<Optional<R>>
AColumnMapperwhich is apropriate for retrievingnullablecolumns from aResultSet. If the result from a mapping (or anyFunctionin the mapping chain) isnull, the result is alwaysOptional.empty(), and the chain of any remaining mapping functions are "short-circuited" and not invoked.
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default <S> NullableColumnMapper<S>andThen(Function<? super R,S> mapper)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 Detail
-
of
static <R> NullableColumnMapper<R> of(ThrowingBiFunction<String,ResultSet,R,? extends SQLException> function)
-
andThen
default <S> NullableColumnMapper<S> andThen(Function<? super R,S> mapper)
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
-
-