[jOOQ/jOOQ#17566] Add DataType.getFromType(): Class<?> and

DataType.getToType(): Class<T>
This commit is contained in:
Lukas Eder 2024-11-06 13:48:07 +01:00
parent 077ac9001b
commit 37431552e6
2 changed files with 24 additions and 0 deletions

View File

@ -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.

View File

@ -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());