Package org.apache.druid.segment.column
Class Types
- java.lang.Object
-
- org.apache.druid.segment.column.Types
-
public class Types extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Types.IncompatibleTypeException
-
Constructor Summary
Constructors Constructor Description Types()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends TypeDescriptor>
booleaneither(TypeSignature<T> typeSignature1, TypeSignature<T> typeSignature2, T typeDescriptor)
Returns true if either suppliedTypeSignature.getType()
is the givenTypeDescriptor
Useful for choosing a commonTypeDescriptor
between twoTypeSignature
when one of the signatures might be null.static <T extends TypeSignature<?>>
TfromString(TypeFactory<T> typeFactory, String typeString)
static <T extends TypeDescriptor>
booleanis(TypeSignature<T> typeSignature, T typeDescriptor)
Returns true ifTypeSignature.getType()
is of the specifiedTypeDescriptor
static <T extends TypeDescriptor>
booleanisNullOr(TypeSignature<T> typeSignature, T typeDescriptor)
Returns true ifTypeSignature.getType()
is null, or of the specifiedTypeDescriptor
static <T extends TypeDescriptor>
booleanisNullOrAnyOf(TypeSignature<T> typeSignature, T... typeDescriptors)
Returns true if theTypeSignature
is null, or is any one of the specifiedTypeDescriptor
static <T extends TypeDescriptor>
booleanisNumeric(TypeSignature<T> typeSignature)
Returns true ifTypeSignature
is not null and isTypeSignature.isNumeric()
static <T extends TypeDescriptor>
booleanisNumericOrNumericArray(TypeSignature<T> typeSignature)
Returns true ifTypeSignature
is not null and isTypeSignature.isNumeric()
or hasTypeSignature.getElementType()
that is numeric.
-
-
-
Method Detail
-
fromString
@Nullable public static <T extends TypeSignature<?>> T fromString(TypeFactory<T> typeFactory, @Nullable String typeString)
-
is
public static <T extends TypeDescriptor> boolean is(@Nullable TypeSignature<T> typeSignature, T typeDescriptor)
Returns true ifTypeSignature.getType()
is of the specifiedTypeDescriptor
-
isNullOr
public static <T extends TypeDescriptor> boolean isNullOr(@Nullable TypeSignature<T> typeSignature, T typeDescriptor)
Returns true ifTypeSignature.getType()
is null, or of the specifiedTypeDescriptor
-
isNullOrAnyOf
public static <T extends TypeDescriptor> boolean isNullOrAnyOf(@Nullable TypeSignature<T> typeSignature, T... typeDescriptors)
Returns true if theTypeSignature
is null, or is any one of the specifiedTypeDescriptor
-
either
public static <T extends TypeDescriptor> boolean either(@Nullable TypeSignature<T> typeSignature1, @Nullable TypeSignature<T> typeSignature2, T typeDescriptor)
Returns true if either suppliedTypeSignature.getType()
is the givenTypeDescriptor
Useful for choosing a commonTypeDescriptor
between twoTypeSignature
when one of the signatures might be null.
-
isNumeric
public static <T extends TypeDescriptor> boolean isNumeric(@Nullable TypeSignature<T> typeSignature)
Returns true ifTypeSignature
is not null and isTypeSignature.isNumeric()
-
isNumericOrNumericArray
public static <T extends TypeDescriptor> boolean isNumericOrNumericArray(@Nullable TypeSignature<T> typeSignature)
Returns true ifTypeSignature
is not null and isTypeSignature.isNumeric()
or hasTypeSignature.getElementType()
that is numeric.
-
-