Class UserType
java.lang.Object
org.apache.cassandra.cql3.functions.types.DataType
org.apache.cassandra.cql3.functions.types.UserType
- All Implemented Interfaces:
Iterable<UserType.Field>
A User Defined Type (UDT).
A UDT is a essentially a named collection of fields (with a name and a type).
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.cassandra.cql3.functions.types.DataType
DataType.CollectionType, DataType.CustomType, DataType.Name, DataType.NativeType -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a String representation of this data type suitable for inclusion as a parameter type in a function or aggregate signature.booleanReturns whether this UDT contains a given field.copy(boolean newFrozen) booleanThe name of the keyspace this UDT is part of.The name of this user type.inthashCode()booleanisFrozen()Returns whether this data type is frozen.iterator()Returns an iterator over the fields of this UDT.newValue()Returns a new empty value for this user type definition.intsize()Returns the number of fields in this UDT.toString()Methods inherited from class org.apache.cassandra.cql3.functions.types.DataType
ascii, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, duration, getName, getTypeArguments, inet, isCollection, list, list, map, map, set, set, smallint, text, time, timestamp, timeuuid, tinyint, uuid, varchar, varint, vectorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
newValue
Returns a new empty value for this user type definition.- Returns:
- an empty value for this user type definition.
-
getKeyspace
The name of the keyspace this UDT is part of.- Returns:
- the name of the keyspace this UDT is part of.
-
getTypeName
The name of this user type.- Returns:
- the name of this user type.
-
size
public int size()Returns the number of fields in this UDT.- Returns:
- the number of fields in this UDT.
-
contains
Returns whether this UDT contains a given field.- Parameters:
name- the name to check. Note thatnameobey the usual CQL identifier rules: it should be quoted if it denotes a case sensitive identifier (you can useMetadata.quote(java.lang.String)for the quoting).- Returns:
trueif this UDT contains a field namedname,falseotherwise.
-
iterator
Returns an iterator over the fields of this UDT.- Specified by:
iteratorin interfaceIterable<UserType.Field>- Returns:
- an iterator over the fields of this UDT.
-
isFrozen
public boolean isFrozen()Description copied from class:DataTypeReturns whether this data type is frozen.This applies to User Defined Types, tuples and nested collections. Frozen types are serialized as a single value in Cassandra's storage engine, whereas non-frozen types are stored in a form that allows updates to individual subfields.
-
copy
-
hashCode
public int hashCode() -
equals
-
toString
-
asFunctionParameterString
Description copied from class:DataTypeReturns a String representation of this data type suitable for inclusion as a parameter type in a function or aggregate signature.In such places, the String representation might vary from the canonical one as returned by
Object.toString(); e.g. thefrozenkeyword is not accepted.- Overrides:
asFunctionParameterStringin classDataType- Returns:
- a String representation of this data type suitable for inclusion as a parameter type in a function or aggregate signature.
-