public class UserType extends DataType implements java.lang.Iterable<UserType.Field>
A UDT is a essentially a named collection of fields (with a name and a type).
Modifier and Type | Class and Description |
---|---|
static class |
UserType.Field
A UDT field.
|
DataType.CollectionType, DataType.CustomType, DataType.Name, DataType.NativeType
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asFunctionParameterString()
Returns a String representation of this data type suitable for inclusion as a parameter type in
a function or aggregate signature.
|
boolean |
contains(java.lang.String name)
Returns whether this UDT contains a given field.
|
UserType |
copy(boolean newFrozen) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getKeyspace()
The name of the keyspace this UDT is part of.
|
java.lang.String |
getTypeName()
The name of this user type.
|
int |
hashCode() |
boolean |
isFrozen()
Returns whether this data type is frozen.
|
java.util.Iterator<UserType.Field> |
iterator()
Returns an iterator over the fields of this UDT.
|
UDTValue |
newValue()
Returns a new empty value for this user type definition.
|
int |
size()
Returns the number of fields in this UDT.
|
java.lang.String |
toString() |
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
public UDTValue newValue()
public java.lang.String getKeyspace()
public java.lang.String getTypeName()
public int size()
public boolean contains(java.lang.String name)
name
- the name to check. Note that name
obey the usual CQL identifier rules: it
should be quoted if it denotes a case sensitive identifier (you can use Metadata.quote(java.lang.String)
for the quoting).true
if this UDT contains a field named name
, false
otherwise.public java.util.Iterator<UserType.Field> iterator()
iterator
in interface java.lang.Iterable<UserType.Field>
public boolean isFrozen()
DataType
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.
public UserType copy(boolean newFrozen)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String asFunctionParameterString()
DataType
In such places, the String representation might vary from the canonical one as returned by
Object.toString()
; e.g. the frozen
keyword is not accepted.
asFunctionParameterString
in class DataType
Copyright © 2009-2022 The Apache Software Foundation