public class UserType extends DataType implements Iterable<UserType.Field>
Modifier and Type | Class and Description |
---|---|
static class |
UserType.Field
A UDT field.
|
DataType.Name
Modifier and Type | Method and Description |
---|---|
String |
asCQLQuery()
Returns a CQL query representing this user type.
|
boolean |
contains(String name)
Returns whether this UDT contains a given field.
|
boolean |
equals(Object o) |
String |
exportAsString()
Returns a CQL query representing this user type in human readable form.
|
Collection<String> |
getFieldNames()
Returns the names of the fields of this UDT.
|
DataType |
getFieldType(String name)
Returns the type of a given field.
|
String |
getKeyspace()
The name of the keyspace this UDT is part of.
|
String |
getTypeName()
The name of this user type.
|
int |
hashCode() |
boolean |
isFrozen()
Returns whether this data type is frozen.
|
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.
|
String |
toString() |
allPrimitiveTypes, ascii, asJavaClass, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, decimal, deserialize, deserialize, deserialize, format, frozenList, frozenMap, frozenSet, getCustomTypeClassName, getName, getTypeArguments, inet, isCollection, list, list, map, map, parse, serialize, serialize, serialize, serializeValue, serializeValue, serializeValue, set, set, text, timestamp, timeuuid, uuid, varchar, varint
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public UDTValue newValue()
public String getKeyspace()
public String getTypeName()
public int size()
public boolean contains(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 Iterator<UserType.Field> iterator()
iterator
in interface Iterable<UserType.Field>
public Collection<String> getFieldNames()
public DataType getFieldType(String name)
name
- the name of the field. 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).name
if this UDT has a field of this
name, null
otherwise.IllegalArgumentException
- if name
is not a field of this
UDT definition.public boolean isFrozen()
DataType
public String exportAsString()
asCQLQuery()
but the ouptut is
formatted to be human readable (for some definition of human readable).public String asCQLQuery()
exportAsString()