[jOOQ/jOOQ#14538] Add DataType.isFloat()

This commit is contained in:
Lukas Eder 2023-01-23 10:18:42 +01:00
parent 4882d723ba
commit 5ec55cbeef
2 changed files with 20 additions and 0 deletions

View File

@ -1250,6 +1250,18 @@ public interface DataType<T> extends Named {
*/
boolean isInteger();
/**
* Whether this data type is any floating point data type.
* <p>
* This applies to any of these types:
* <ul>
* <li> {@link SQLDataType#FLOAT}</li>
* <li> {@link SQLDataType#DOUBLE}</li>
* <li> {@link SQLDataType#REAL}</li>
* </ul>
*/
boolean isFloat();
/**
* Whether this data type is any boolean data type.
* <p>

View File

@ -802,6 +802,14 @@ implements
;
}
@Override
public final boolean isFloat() {
Class<?> tType = tType0();
return Float.class == tType
|| Double.class == tType
;
}
@Override
public final boolean isBoolean() {
return tType0() == Boolean.class;