[jOOQ/jOOQ#17566] Add DataType.getFromType(): Class<?> and
DataType.getToType(): Class<T>
This commit is contained in:
parent
077ac9001b
commit
37431552e6
@ -148,10 +148,24 @@ public interface DataType<T> extends Named {
|
||||
|
||||
/**
|
||||
* Retrieve the Java type associated with this data type.
|
||||
* <p>
|
||||
* This is the same as {@link #getUserType()}.
|
||||
*/
|
||||
@NotNull
|
||||
Class<T> getType();
|
||||
|
||||
/**
|
||||
* The {@link Converter#fromType()} (or database type) in case this {@link DataType} has a converter.
|
||||
*/
|
||||
@NotNull
|
||||
Class<?> getFromType();
|
||||
|
||||
/**
|
||||
* The {@link Converter#toType()} (or user type) in case this {@link DataType} has a converter.
|
||||
*/
|
||||
@NotNull
|
||||
Class<T> getToType();
|
||||
|
||||
/**
|
||||
* Get the defining DOMAIN type or <code>NULL</code> if there is no such
|
||||
* type.
|
||||
|
||||
@ -631,6 +631,16 @@ implements
|
||||
return (@NotNull ContextConverter<?, T>) ContextConverter.scoped(getBinding().converter());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Class<?> getFromType() {
|
||||
return getConverter().fromType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Class<T> getToType() {
|
||||
return getConverter().toType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public /* non-final */ String getTypeName() {
|
||||
return getTypeName0(CONFIG_UNQUOTED.get());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user