org.jooq
Interface Converter<T,U>

Type Parameters:
T - The database type - i.e. any type available from SQLDataType
U - The user type
All Superinterfaces:
Serializable
All Known Implementing Classes:
EnumConverter

public interface Converter<T,U>
extends Serializable

A Converter for data types.

A general data type conversion interface that can be provided to jOOQ at various places in order to perform custom data type conversion. Conversion is directed, this means that the Converter is used

Note: In order to avoid unwanted side-effects, it is highly recommended (yet not required) for from(Object) and to(Object) to be reciprocal. The two methods are reciprocal, if for all X and Y, it can be said that

Furthermore, it is recommended (yet not required) that

Author:
Lukas Eder

Method Summary
 U from(T databaseObject)
          Convert a database object to a user object
 Class<T> fromType()
          The database type
 T to(U userObject)
          Convert a user object to a database object
 Class<U> toType()
          The user type
 

Method Detail

from

U from(T databaseObject)
Convert a database object to a user object

Parameters:
databaseObject - The database object
Returns:
The user object

to

T to(U userObject)
Convert a user object to a database object

Parameters:
userObject - The user object
Returns:
The database object

fromType

Class<T> fromType()
The database type


toType

Class<U> toType()
The user type



Copyright © 2012. All Rights Reserved.