Class EnumMapper<E extends Enum<E>>
java.lang.Object
org.jdbi.v3.core.mapper.EnumMapper<E>
- Type Parameters:
E
- the enum type mapped
- All Implemented Interfaces:
ColumnMapper<E>
Column mapper for Java
enum
types.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Enum<E>>
ColumnMapper<E> Map database string values to enum names.static <E extends Enum<E>>
ColumnMapper<E> Map database integer values to enum ordinal values.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jdbi.v3.core.mapper.ColumnMapper
init, map, map
-
Method Details
-
byName
Map database string values to enum names.- Type Parameters:
E
- the enum type to map- Parameters:
type
- the enum type to map- Returns:
- an enum mapper that matches on
Enum.name()
-
byOrdinal
Map database integer values to enum ordinal values.- Type Parameters:
E
- the enum type to map- Parameters:
type
- the enum type to map- Returns:
- an enum mapper that matches on
Enum.ordinal()
-