Package org.jdbi.v3.core.mapper
Class InferredColumnMapperFactory
- java.lang.Object
-
- org.jdbi.v3.core.mapper.InferredColumnMapperFactory
-
- All Implemented Interfaces:
QualifiedColumnMapperFactory
class InferredColumnMapperFactory extends java.lang.Object implements QualifiedColumnMapperFactory
A generic QualifiedColumnMapperFactory that reflectively inspects aColumnMapper<T>and maps only to columns of typeT, with type qualifiers equal to the qualifiers present on the mapper class. The type parameter T must be accessible via reflection or anUnsupportedOperationExceptionwill be thrown.
-
-
Field Summary
Fields Modifier and Type Field Description private ColumnMapper<?>mapperprivate QualifiedType<?>maps
-
Constructor Summary
Constructors Constructor Description InferredColumnMapperFactory(ColumnMapper<?> mapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<ColumnMapper<?>>build(QualifiedType<?> type, ConfigRegistry config)Supplies a column mapper which will map columns to type if the factory supports it; empty otherwise.
-
-
-
Field Detail
-
maps
private final QualifiedType<?> maps
-
mapper
private final ColumnMapper<?> mapper
-
-
Constructor Detail
-
InferredColumnMapperFactory
InferredColumnMapperFactory(ColumnMapper<?> mapper)
-
-
Method Detail
-
build
public java.util.Optional<ColumnMapper<?>> build(QualifiedType<?> type, ConfigRegistry config)
Description copied from interface:QualifiedColumnMapperFactorySupplies a column mapper which will map columns to type if the factory supports it; empty otherwise.- Specified by:
buildin interfaceQualifiedColumnMapperFactory- Parameters:
type- the target qualified type to map toconfig- the config registry, for composition- Returns:
- a column mapper for the given type if this factory supports it, or
Optional.empty()otherwise. - See Also:
for composition,QualifiedType
-
-