Interface BasicColumnMapper<R>

  • Type Parameters:
    R - The type of the result.
    All Superinterfaces:
    ColumnMapper<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 BasicColumnMapper<R>
    extends ColumnMapper<R>
    The basic ColumnMapper retrieves a value from a ResultSet, and offers a way to compose a chain of functions that maps the value. As the value retrieved from the ResultSet is unconditionally passed down the chain of mapping functions, if retrieving a value from a nullable column, consider using a NullableColumnMapper instead.
    See Also:
    NullableColumnMapper
    • Method Detail

      • andThen

        default <S> BasicColumnMapper<S> andThen​(Function<? super R,​S> mapper)
        Create a new BasicColumnMapper which will map the result of this one using the given function.
        Type Parameters:
        S - The type of object the new ColumnMapper yields from a ResultSet
        Parameters:
        mapper - the mapping function
        Returns:
        the new mapper
        See Also:
        nullFallthrough()
      • nullFallthrough

        default BasicColumnMapper<R> nullFallthrough()
        Specify that a retrieved null value will short circuit any chain from this point. A mapping chain can be constructed with andThen(Function), and if a value retrieved from a ResultSet is nullable, usually this should pass unchanged through a chain of mappers as null. This eliminates the need for the mapping functions to handle nulls.

        This should be used for rare circumstances where the result from a function passed to andThen(Function) can be null. If mapping a nullable database column, consider using a NullableColumnMapper instead.

        Returns:
        a new ColumnMapper
        See Also:
        NullableColumnMapper