Package org.jdbi.v3.core.codec
Class CodecFactory
java.lang.Object
org.jdbi.v3.core.codec.CodecFactory
- All Implemented Interfaces:
- QualifiedArgumentFactory,- QualifiedArgumentFactory.Preparable,- QualifiedColumnMapperFactory
- Direct Known Subclasses:
- TypeResolvingCodecFactory
@ThreadSafe
@Beta
public class CodecFactory
extends Object
implements QualifiedColumnMapperFactory, QualifiedArgumentFactory.Preparable
CodecFactory provides column mappers and arguments for bidirectional mapping types to database columns.
 
This class is immutable and thread safe.
Alpha: this class as public API is redundant with the existing way of managing mappers: we should try to combine them to make the new public API as small as possible
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from interface org.jdbi.v3.core.argument.QualifiedArgumentFactoryQualifiedArgumentFactory.Preparable
- 
Constructor SummaryConstructorsConstructorDescriptionCodecFactory(Map<QualifiedType<?>, Codec<?>> codecMap) Create a new CodecFactory.
- 
Method SummaryModifier and TypeMethodDescriptionbuild(QualifiedType<?> type, Object value, ConfigRegistry config) Returns anArgumentfor the given value if the factory supports it; empty otherwise.final Optional<ColumnMapper<?>> build(QualifiedType<?> type, ConfigRegistry config) Supplies a column mapper which will map columns to type if the factory supports it; empty otherwise.static CodecFactory.Builderbuilder()Returns a builder for fluent API.static CodecFactoryforSingleCodec(QualifiedType<?> type, Codec<?> codec) prepare(QualifiedType<?> type, ConfigRegistry config) final Collection<QualifiedType<?>> Deprecated.no longer used
- 
Constructor Details- 
CodecFactoryCreate a new CodecFactory.
 
- 
- 
Method Details- 
builderReturns a builder for fluent API.
- 
forSingleCodec
- 
preparepublic final Optional<Function<Object,Argument>> prepare(QualifiedType<?> type, ConfigRegistry config) - Specified by:
- preparein interface- QualifiedArgumentFactory.Preparable
 
- 
prePreparedTypesDeprecated.no longer used- Specified by:
- prePreparedTypesin interface- QualifiedArgumentFactory.Preparable
 
- 
buildDescription copied from interface:QualifiedArgumentFactoryReturns anArgumentfor the given value if the factory supports it; empty otherwise.- Specified by:
- buildin interface- QualifiedArgumentFactory
- Parameters:
- type- the known qualified type of value. Depending on the situation this may be a full generic signature e.g.- ParameterizedType, a- Class, or Object.class if no type information is known.
- value- the value to convert into an- Argument
- config- the config registry, for composition
- Returns:
- an argument for the given value if this factory supports it, or Optional.empty()otherwise.
- See Also:
 
- 
buildDescription copied from interface:QualifiedColumnMapperFactorySupplies a column mapper which will map columns to type if the factory supports it; empty otherwise.- Specified by:
- buildin interface- QualifiedColumnMapperFactory
- Parameters:
- type- the target qualified type to map to
- config- the config registry, for composition
- Returns:
- a column mapper for the given type if this factory supports it, or Optional.empty()otherwise.
- See Also:
 
 
-