Interface SqlArrayTypeFactory

  • All Known Implementing Classes:
    EnumSqlArrayTypeFactory, InferredSqlArrayTypeFactory
    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 SqlArrayTypeFactory
    Factory interface to produce SqlArrayType instances.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Optional<SqlArrayType<?>> build​(java.lang.reflect.Type elementType, ConfigRegistry config)
      Returns an SqlArrayType for the given elementType if this factory supports it; empty otherwise.
      static <T> SqlArrayTypeFactory of​(java.lang.Class<T> elementType, java.lang.String typeName, java.util.function.Function<T,​?> conversion)
      Create a SqlArrayTypeFactory for the given elementType that binds using a type name and convert function.
    • Method Detail

      • build

        java.util.Optional<SqlArrayType<?>> build​(java.lang.reflect.Type elementType,
                                                  ConfigRegistry config)
        Returns an SqlArrayType for the given elementType if this factory supports it; empty otherwise.
        Parameters:
        elementType - the array element type
        config - the config registry, for composition
        Returns:
        an SqlArrayType for the given elementType if this factory supports it; empty otherwise.
        See Also:
        SqlArrayTypes.findFor(Type)
      • of

        static <T> SqlArrayTypeFactory of​(java.lang.Class<T> elementType,
                                          java.lang.String typeName,
                                          java.util.function.Function<T,​?> conversion)
        Create a SqlArrayTypeFactory for the given elementType that binds using a type name and convert function.
        Parameters:
        elementType - the array element type
        typeName - the database type name to bind as
        conversion - the function to convert to jdbc representation
        Returns:
        the built factory
        See Also:
        SqlArrayType.of(String, Function)