Interface Codec<T>

  • All Known Implementing Classes:
    PostgisCodec

    @Alpha
    public interface Codec<T>
    A Codec provides a convenient way for a bidirectional mapping of an attribute to a database column.

    Groups a ColumnMapper and an Argument mapping function for a given type.

    Alpha: this interface is still evolving! It might eventually replace the existing Mappers and Arguments.

    • Method Detail

      • getArgumentFunction

        default java.util.function.Function<T,​Argument> getArgumentFunction()
        Returns a Function that creates an Argument to map an attribute value onto the database column.

        Either this method or getArgumentFunction(ConfigRegistry) must be implemented.

      • getArgumentFunction

        default java.util.function.Function<T,​Argument> getArgumentFunction​(ConfigRegistry configRegistry)
        Returns a Function that creates an Argument to map an attribute value onto the database column.

        This method is optional. If it is not implemented, the result of getArgumentFunction() is returned.

        Parameters:
        configRegistry - The ConfigRegistry that this argument belongs to.