T
- The database type - i.e. any type available from
SQLDataType
U
- The user typepublic class Converters<T,U> extends Object implements Converter<T,U>
Modifier and Type | Method and Description |
---|---|
U |
from(T t)
Convert a database object to a user object
|
Class<T> |
fromType()
The database type
|
static <T> Converter<T,T> |
identity(Class<T> type)
Create an identity converter.
|
static <T,U> Converter<U,T> |
inverse(Converter<T,U> converter)
Inverse a converter.
|
static <T,U> Converter<T,U> |
of()
Create an identity converter.
|
static <T,U> Converter<T,U> |
of(Converter<T,U> converter)
Create a single converter.
|
static <T,X1,U> Converter<T,U> |
of(Converter<T,X1> c1,
Converter<X1,U> c2)
Chain two converters.
|
static <T,X1,X2,U> |
of(Converter<T,X1> c1,
Converter<X1,X2> c2,
Converter<X2,U> c3)
Chain three converters.
|
static <T,X1,X2,X3,U> |
of(Converter<T,X1> c1,
Converter<X1,X2> c2,
Converter<X2,X3> c3,
Converter<X3,U> c4)
Chain four converters.
|
T |
to(U u)
Convert a user object to a database object
|
String |
toString() |
Class<U> |
toType()
The user type
|
public static <T,U> Converter<T,U> of()
public static <T,X1,U> Converter<T,U> of(Converter<T,X1> c1, Converter<X1,U> c2)
public static <T,X1,X2,U> Converter<T,U> of(Converter<T,X1> c1, Converter<X1,X2> c2, Converter<X2,U> c3)
public static <T,X1,X2,X3,U> Converter<T,U> of(Converter<T,X1> c1, Converter<X1,X2> c2, Converter<X2,X3> c3, Converter<X3,U> c4)
public final U from(T t)
Converter
public final T to(U u)
Converter
public final Class<T> fromType()
Converter
Copyright © 2016. All Rights Reserved.