Class UDFDataType
java.lang.Object
org.apache.cassandra.cql3.functions.UDFDataType
Represents a data type used within the UDF/UDA.
Internaly, UDFs and UDAs use the Java driver types. This class maintains the mapping between the C* type
and the corresponding java driver type.
-
Method Summary
Modifier and TypeMethodDescriptioncompose(ProtocolVersion protocolVersion, ByteBuffer buffer) Deserializes the specified oject.decompose(ProtocolVersion protocolVersion, byte value) Serialized the specified byte.decompose(ProtocolVersion protocolVersion, double value) Serialized the specified byte.decompose(ProtocolVersion protocolVersion, float value) Serialized the specified byte.decompose(ProtocolVersion protocolVersion, int value) Serialized the specified byte.decompose(ProtocolVersion protocolVersion, long value) Serialized the specified byte.decompose(ProtocolVersion protocolVersion, short value) Serialized the specified byte.decompose(ProtocolVersion protocolVersion, Object value) Serialized the specified oject.booleaninthashCode()booleanChecks if this type is corresponding to a Java primitive type.AbstractType<?>Converts this type into the corresponding Cassandra type.Converts this type into the corresponding Java driver type.Class<?>Converts this type into the corresponding Java class.static List<UDFDataType>wrap(List<AbstractType<?>> argTypes, boolean usePrimitive) Returns theUDFDataTypes corresponding to the specified types.static UDFDataTypewrap(AbstractType<?> abstractType, boolean usePrimitive) Returns theUDFDataTypecorresponding to the specified type.
-
Method Details
-
toAbstractType
Converts this type into the corresponding Cassandra type.- Returns:
- the corresponding Cassandra type
-
toJavaClass
Converts this type into the corresponding Java class.- Returns:
- the corresponding Java class.
-
getJavaTypeName
- Returns:
- the name of the java type corresponding to this class.
-
isPrimitive
public boolean isPrimitive()Checks if this type is corresponding to a Java primitive type.- Returns:
trueif this type is corresponding to a Java primitive type,falseotherwise.
-
wrap
Returns theUDFDataTypecorresponding to the specified type.- Parameters:
abstractType- the Cassandra typeusePrimitive-trueif the primitive type can be used.- Returns:
- the
UDFDataTypecorresponding to the specified type.
-
wrap
Returns theUDFDataTypes corresponding to the specified types.- Parameters:
argTypes- the Cassandra typesusePrimitive-trueif the primitive types can be used.- Returns:
- the
UDFDataTypes corresponding to the specified types.
-
toDataType
Converts this type into the corresponding Java driver type.- Returns:
- the corresponding Java driver type.
-
hashCode
public int hashCode() -
equals
-
compose
Deserializes the specified oject.- Parameters:
protocolVersion- the protocol versionbuffer- the serialized object- Returns:
- the deserialized object
-
decompose
Serialized the specified oject.- Parameters:
protocolVersion- the protocol versionvalue- the value to serialize- Returns:
- the serialized object
-
decompose
Serialized the specified byte.- Parameters:
protocolVersion- the protocol versionvalue- the value to serialize- Returns:
- the serialized byte
-
decompose
Serialized the specified byte.- Parameters:
protocolVersion- the protocol versionvalue- the value to serialize- Returns:
- the serialized byte
-
decompose
Serialized the specified byte.- Parameters:
protocolVersion- the protocol versionvalue- the value to serialize- Returns:
- the serialized byte
-
decompose
Serialized the specified byte.- Parameters:
protocolVersion- the protocol versionvalue- the value to serialize- Returns:
- the serialized byte
-
decompose
Serialized the specified byte.- Parameters:
protocolVersion- the protocol versionvalue- the value to serialize- Returns:
- the serialized byte
-
decompose
Serialized the specified byte.- Parameters:
protocolVersion- the protocol versionvalue- the value to serialize- Returns:
- the serialized byte
-
getArgumentDeserializer
-