Class UDHelper
- java.lang.Object
-
- org.apache.cassandra.cql3.functions.UDHelper
-
public final class UDHelper extends java.lang.Object
Helper class for User Defined Functions, Types and Aggregates.
-
-
Constructor Summary
Constructors Constructor Description UDHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<?>
asJavaClass(TypeCodec<?> codec)
static TypeCodec<java.lang.Object>
codecFor(DataType dataType)
static java.lang.Object
deserialize(TypeCodec<?> codec, ProtocolVersion protocolVersion, java.nio.ByteBuffer value)
static DataType
driverType(AbstractType abstractType)
Returns theDataType
for the C* internal type.static DataType
driverTypeFromAbstractType(java.lang.String abstractTypeDef)
static DataType[]
driverTypes(java.util.List<AbstractType<?>> abstractTypes)
Construct an array containing theDataType
s for the C* internal types.static boolean
isNullOrEmpty(AbstractType<?> type, java.nio.ByteBuffer bb)
static java.nio.ByteBuffer
serialize(TypeCodec<?> codec, ProtocolVersion protocolVersion, java.lang.Object value)
static com.google.common.reflect.TypeToken<?>[]
typeTokens(TypeCodec<java.lang.Object>[] dataTypes, boolean calledOnNullInput)
Construct an array containing the Java classes for the givenDataType
s.
-
-
-
Method Detail
-
typeTokens
public static com.google.common.reflect.TypeToken<?>[] typeTokens(TypeCodec<java.lang.Object>[] dataTypes, boolean calledOnNullInput)
Construct an array containing the Java classes for the givenDataType
s.- Parameters:
dataTypes
- array with UDF argument typescalledOnNullInput
- whether to allownull
as an argument value- Returns:
- array of same size with UDF arguments
-
driverTypes
public static DataType[] driverTypes(java.util.List<AbstractType<?>> abstractTypes)
Construct an array containing theDataType
s for the C* internal types.- Parameters:
abstractTypes
- list with UDF argument types- Returns:
- array with argument types as
DataType
-
driverType
public static DataType driverType(AbstractType abstractType)
Returns theDataType
for the C* internal type.
-
driverTypeFromAbstractType
public static DataType driverTypeFromAbstractType(java.lang.String abstractTypeDef)
-
deserialize
public static java.lang.Object deserialize(TypeCodec<?> codec, ProtocolVersion protocolVersion, java.nio.ByteBuffer value)
-
serialize
public static java.nio.ByteBuffer serialize(TypeCodec<?> codec, ProtocolVersion protocolVersion, java.lang.Object value)
-
asJavaClass
public static java.lang.Class<?> asJavaClass(TypeCodec<?> codec)
-
isNullOrEmpty
public static boolean isNullOrEmpty(AbstractType<?> type, java.nio.ByteBuffer bb)
-
-