Package org.jdbi.v3.core.array
Class InferredSqlArrayTypeFactory
- java.lang.Object
-
- org.jdbi.v3.core.array.InferredSqlArrayTypeFactory
-
- All Implemented Interfaces:
SqlArrayTypeFactory
class InferredSqlArrayTypeFactory extends java.lang.Object implements SqlArrayTypeFactory
A genericSqlArrayTypeFactorythat reflectively inspects anSqlArrayTypeand maps only arrays of element typeT. The type parameterTmust be accessible via reflection or anUnsupportedOperationExceptionwill be thrown.
-
-
Field Summary
Fields Modifier and Type Field Description private SqlArrayType<?>arrayTypeprivate java.lang.reflect.TypeinferredElementType
-
Constructor Summary
Constructors Constructor Description InferredSqlArrayTypeFactory(SqlArrayType<?> arrayType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<SqlArrayType<?>>build(java.lang.reflect.Type elementType, ConfigRegistry config)Returns anSqlArrayTypefor the givenelementTypeif this factory supports it; empty otherwise.
-
-
-
Field Detail
-
inferredElementType
private final java.lang.reflect.Type inferredElementType
-
arrayType
private final SqlArrayType<?> arrayType
-
-
Constructor Detail
-
InferredSqlArrayTypeFactory
InferredSqlArrayTypeFactory(SqlArrayType<?> arrayType)
-
-
Method Detail
-
build
public java.util.Optional<SqlArrayType<?>> build(java.lang.reflect.Type elementType, ConfigRegistry config)
Description copied from interface:SqlArrayTypeFactoryReturns anSqlArrayTypefor the givenelementTypeif this factory supports it; empty otherwise.- Specified by:
buildin interfaceSqlArrayTypeFactory- Parameters:
elementType- the array element typeconfig- the config registry, for composition- Returns:
- an
SqlArrayTypefor the givenelementTypeif this factory supports it; empty otherwise. - See Also:
SqlArrayTypes.findFor(Type)
-
-