Package org.jdbi.v3.core.argument
Class EnumArgumentFactory
java.lang.Object
org.jdbi.v3.core.argument.EnumArgumentFactory
- All Implemented Interfaces:
QualifiedArgumentFactory
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jdbi.v3.core.argument.QualifiedArgumentFactory
QualifiedArgumentFactory.Preparable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionannotatedValue(E e) build(QualifiedType<?> givenType, Object value, ConfigRegistry config) Returns anArgumentfor the given value if the factory supports it; empty otherwise.byName(E value, ConfigRegistry config) byOrdinal(E value, ConfigRegistry config) makeArgument(int nullType, Class<A> attributeType, E value, Function<E, A> transform, ConfigRegistry config) makeEnumArgument(QualifiedType<E> givenType, E value, ConfigRegistry config)
-
Constructor Details
-
EnumArgumentFactory
EnumArgumentFactory()
-
-
Method Details
-
build
Description copied from interface:QualifiedArgumentFactoryReturns anArgumentfor the given value if the factory supports it; empty otherwise.- Specified by:
buildin interfaceQualifiedArgumentFactory- Parameters:
givenType- the known qualified type of value. Depending on the situation this may be a full generic signature e.g.ParameterizedType, aClass, or Object.class if no type information is known.value- the value to convert into anArgumentconfig- the config registry, for composition- Returns:
- an argument for the given value if this factory supports it, or
Optional.empty()otherwise. - See Also:
-
ifEnum
-
makeEnumArgument
private static <E extends Enum<E>> Optional<Argument> makeEnumArgument(QualifiedType<E> givenType, E value, ConfigRegistry config) -
byName
-
annotatedValue
-
byOrdinal
-
makeArgument
-