public class UserType extends DataType implements Iterable<UserType.Field>
| 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 |
|---|---|
String |
asCQLQuery()
Returns a CQL query representing this user type.
|
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(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, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, frozenList, frozenMap, frozenSet, getName, getTypeArguments, inet, isCollection, list, list, map, map, set, set, smallint, text, time, timestamp, timeuuid, tinyint, uuid, varchar, varintclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic 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()
DataTypepublic String exportAsString()
asCQLQuery() but the ouptut is
formatted to be human readable (for some definition of human readable).public String asCQLQuery()
exportAsString()public String asFunctionParameterString()
DataTypeObject.toString();
e.g. the frozen keyword is not accepted.asFunctionParameterString in class DataType