[#7387] Add DataType.isEnum()

This commit is contained in:
lukaseder 2018-04-04 17:46:09 +03:00
parent c7aac7b762
commit 2ec9a789f9
2 changed files with 10 additions and 0 deletions

View File

@ -523,4 +523,9 @@ public interface DataType<T> extends Serializable {
* Whether this data type is a UDT type.
*/
boolean isUDT();
/**
* Whether this data type is an enum type.
*/
boolean isEnum();
}

View File

@ -939,6 +939,11 @@ public class DefaultDataType<T> implements DataType<T> {
return UDTRecord.class.isAssignableFrom(tType);
}
@Override
public final boolean isEnum() {
return EnumType.class.isAssignableFrom(tType);
}
// ------------------------------------------------------------------------
// The Object API
// ------------------------------------------------------------------------