Top Description Fields Constructors Methods
org.jooq.impl

public Class EnumConverter<T, U extends java.lang.Enum<U>>

extends AbstractConverter<T, U extends Enum<U>>
Class Inheritance
Static Imports
org.jooq.impl.Convert.convert, .Internal.converterContext, org.jooq.tools.reflect.Reflect.wrapper

A base class for enum conversion.
Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private final Map<T, U>
private final Function<? super U, ? extends T>

Constructor Summary

AccessConstructor and Description
public
EnumConverter(Class<T> fromType, Class<U> toType)

public
EnumConverter(Class<T> fromType, Class<U> toType, Function<? super U, ? extends T> to)

Method Summary

Modifier and TypeMethod and Description
public final U
from(T
The database object.
t
)

Implements org.jooq.Converter.from.

Read and convert a database object to a user object.
public T
to(U
The user object.
u
)

Implements org.jooq.Converter.to.

Subclasses may override this method to provide a custom reverse mapping implementation

Convert and write a user object to a database object.

public String
toString()

Overrides org.jooq.impl.AbstractConverter.toString.

Returns a string representation of the object.
Inherited from org.jooq.impl.AbstractConverter:
fromTypetoType

Field Detail

lookupback to summary
private final Map<T, U> lookup
toback to summary
private final Function<? super U, ? extends T> to

Constructor Detail

EnumConverterback to summary
public EnumConverter(Class<T> fromType, Class<U> toType)
EnumConverterback to summary
public EnumConverter(Class<T> fromType, Class<U> toType, Function<? super U, ? extends T> to)

Method Detail

fromback to summary
public final U from(T t)

Implements org.jooq.Converter.from.

Doc from org.jooq.Converter.from.

Read and convert a database object to a user object.

Parameters
t:T

The database object.

Returns:U

The user object.

Annotations
@Override
toback to summary
public T to(U u)

Implements org.jooq.Converter.to.

Doc from org.jooq.Converter.to.

Subclasses may override this method to provide a custom reverse mapping implementation

Convert and write a user object to a database object.

Parameters
u:U

The user object.

Returns:T

The database object.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.jooq.impl.AbstractConverter.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override