public static class DataTypeImpl.Definition extends Object implements CQLDataType
Definition class provides a data type definition for a CQL
data type.| Modifier and Type | Field and Description |
|---|---|
com.datastax.driver.core.DataType |
dtype
Holds the corresponding Datastax data type.
|
boolean |
isFrozen
Holds a flag indicating if this definition is frozen or not.
|
| Constructor and Description |
|---|
Definition(DataType type)
Instantiates a new
Definition object. |
Definition(StatementManagerImpl mgr,
DataType type,
List<CQLDataType> arguments,
boolean isFrozen)
Instantiates a new
Definition object. |
Definition(StatementManagerImpl mgr,
List<CQLDataType> types,
boolean isFrozen)
Instantiates a new
Definition object. |
| Modifier and Type | Method and Description |
|---|---|
List<CQLDataType> |
getArgumentTypes() |
com.datastax.driver.core.TypeCodec<?> |
getCodec(Class<?> clazz,
com.datastax.driver.core.CodecRegistry codecRegistry)
Gets a codec for this collection data type to decode to the specified class.
|
com.datastax.driver.core.TypeCodec<?> |
getCodec(Field field,
boolean mandatory,
com.datastax.driver.core.CodecRegistry codecRegistry)
Gets a codec for this data type to decode to the specified field.
|
com.datastax.driver.core.DataType |
getDataType() |
CQLDataType |
getElementType() |
CQLDataType |
getFirstArgumentType() |
CQLDataType |
getMainType() |
boolean |
isAlterableTo(CQLDataType to) |
boolean |
isCollection() |
boolean |
isFrozen() |
boolean |
isTuple() |
boolean |
isUserDefined() |
String |
name() |
String |
toCQL() |
String |
toString() |
java.util.stream.Stream<UDTClassInfoImpl<?>> |
udts()
Gets all user-defined types this definition is dependent on.
|
public final com.datastax.driver.core.DataType dtype
public final boolean isFrozen
Note: Only applies to collections.
public Definition(DataType type)
Definition object.type - the non-null primitive data type for this
definitionIllegalArgumentException - if the data type is not a primitive onepublic Definition(StatementManagerImpl mgr, DataType type, List<CQLDataType> arguments, boolean isFrozen)
Definition object.mgr - the non-null statement managertype - the non-null data type for this definitionarguments - the non-null list of arguments' data types
if the type represents a collection (may be empty)isFrozen - true if the data type is frozen; false
otherwiseIllegalArgumentException - if the argument list is empty and the
data type is not a primitive onepublic Definition(StatementManagerImpl mgr, List<CQLDataType> types, boolean isFrozen)
Definition object.mgr - the non-null statement managertypes - the non-null list of data types for this
definition (the first one correspond to the data type and the
remaining are the argument data types)isFrozen - true if the data type is frozen; false
otherwiseIllegalArgumentException - if remaining argument list is empty and
the data type is not a primitive onepublic String name()
name in interface CQLDataTypeCQLDataType.name()public boolean isFrozen()
isFrozen in interface CQLDataTypeCQLDataType.isFrozen()public boolean isCollection()
isCollection in interface CQLDataTypeCQLDataType.isCollection()public boolean isTuple()
isTuple in interface CQLDataTypeCQLDataType.isTuple()public boolean isUserDefined()
isUserDefined in interface CQLDataTypeCQLDataType.isUserDefined()public com.datastax.driver.core.DataType getDataType()
getDataType in interface CQLDataTypeCQLDataType.getDataType()public CQLDataType getMainType()
getMainType in interface CQLDataTypeCQLDataType.getMainType()public CQLDataType getElementType()
getElementType in interface CQLDataTypeCQLDataType.getElementType()public List<CQLDataType> getArgumentTypes()
getArgumentTypes in interface CQLDataTypeCQLDataType.getArgumentTypes()public CQLDataType getFirstArgumentType()
getFirstArgumentType in interface CQLDataTypeCQLDataType.getFirstArgumentType()public boolean isAlterableTo(CQLDataType to)
isAlterableTo in interface CQLDataTypeCQLDataType.isAlterableTo(org.helenus.driver.persistence.CQLDataType)public com.datastax.driver.core.TypeCodec<?> getCodec(Field field, boolean mandatory, com.datastax.driver.core.CodecRegistry codecRegistry)
field - the field decode to its declared typemandatory - if the field is mandatory or represents a primary keycodecRegistry - the codec registry to use when finding a codecNullPointerException - if field or codecRegistry
is nullIllegalArgumentException - if the combination of field and data types
is not supportedpublic com.datastax.driver.core.TypeCodec<?> getCodec(Class<?> clazz, com.datastax.driver.core.CodecRegistry codecRegistry)
clazz - the collection class to decode to its declared super typecodecRegistry - the codec registry to use when finding a codecNullPointerException - if clazz or codecRegistry
is nullIllegalArgumentException - if the combination of class and data types
is not supportedIllegalStateException - if this definition is not representing a
collectionpublic String toCQL()
toCQL in interface CQLDataTypeCQLDataType.toCQL()public java.util.stream.Stream<UDTClassInfoImpl<?>> udts()
public String toString()
toString in class ObjectObject.toString()Copyright (C) 2015-2017 The Helenus Driver Project Authors.