public class UserType extends TupleType implements SchemaElement
AbstractType.ComparisonTypeSchemaElement.SchemaElementTypeAssignmentTestable.TestResult| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
keyspace |
java.nio.ByteBuffer |
name |
comparatorSet, comparisonType, isByteOrderComparable, reverseComparatorNAME_COMPARATOR| Constructor and Description |
|---|
UserType(java.lang.String keyspace,
java.nio.ByteBuffer name,
java.util.List<FieldIdentifier> fieldNames,
java.util.List<AbstractType<?>> fieldTypes,
boolean isMultiCell) |
| Modifier and Type | Method and Description |
|---|---|
CQL3Type |
asCQL3Type() |
CellPath |
cellPathForField(FieldIdentifier fieldName) |
java.util.Optional<Difference> |
compare(UserType other) |
java.lang.String |
elementKeyspace()
Returns the CQL name of the keyspace to which this schema element belong.
|
java.lang.String |
elementName()
Returns the CQL name of this schema element.
|
SchemaElement.SchemaElementType |
elementType()
Return the schema element type
|
boolean |
equals(java.lang.Object o) |
FieldIdentifier |
fieldName(int i) |
java.lang.String |
fieldNameAsString(int i) |
java.util.List<FieldIdentifier> |
fieldNames() |
int |
fieldPosition(FieldIdentifier fieldName) |
AbstractType<?> |
fieldType(int i) |
java.util.List<AbstractType<?>> |
fieldTypes() |
UserType |
freeze() |
AbstractType<?> |
freezeNestedMulticellTypes()
Returns an AbstractType instance that is equivalent to this one, but with all nested UDTs and collections
explicitly frozen.
|
Term |
fromJSONObject(java.lang.Object parsed)
Given a parsed JSON string, return a byte representation of the object.
|
java.lang.String |
getCqlTypeName() |
static UserType |
getInstance(TypeParser parser) |
java.lang.String |
getNameAsString() |
TypeSerializer<java.nio.ByteBuffer> |
getSerializer() |
int |
hashCode() |
boolean |
isFreezable() |
boolean |
isMultiCell() |
boolean |
isTuple() |
boolean |
isUDT() |
boolean |
isValueCompatibleWith(AbstractType<?> previous)
Returns true if values of the other AbstractType can be read and "reasonably" interpreted by the this
AbstractType.
|
ShortType |
nameComparator() |
boolean |
referencesDuration() |
<V> boolean |
referencesUserType(V name,
ValueAccessor<V> accessor) |
java.nio.ByteBuffer |
serializeForNativeProtocol(java.util.Iterator<Cell<?>> cells,
ProtocolVersion protocolVersion) |
java.lang.String |
toCqlString(boolean withInternals,
boolean ifNotExists)
Returns a CQL representation of this element
|
java.lang.String |
toJSONString(java.nio.ByteBuffer buffer,
ProtocolVersion protocolVersion)
Converts the specified value into its JSON representation.
|
java.lang.String |
toString()
This must be overriden by subclasses if necessary so that for any
AbstractType, this == TypeParser.parse(toString()).
|
java.lang.String |
toString(boolean ignoreFreezing) |
<V> void |
validateCell(Cell<V> cell) |
UserType |
withUpdatedUserType(UserType udt)
Returns an instance of this type with all references to the provided user type recursively replaced with its new
definition.
|
allTypes, buildValue, buildValue, compareCustom, expandUserTypes, fromString, getString, isCompatibleWith, isValueCompatibleWithInternal, size, split, subTypes, typeasCQLTypeStringList, checkComparable, compare, compare, compareCollectionMembers, compareForCQL, compose, compose, decompose, getComponents, getString, getString, isCollection, isCounter, isEmptyValueMeaningless, isFrozenCollection, isReversed, parseDefaultParameters, read, readArray, readBuffer, readBuffer, referencesUserType, skipValue, testAssignment, testAssignment, toJSONString, validate, validate, validateCellValue, validateCollectionMember, valueLengthIfFixed, writeValue, writeValue, writtenLength, writtenLengthclone, finalize, getClass, notify, notifyAll, wait, wait, waitelementKeyspaceQuotedIfNeeded, elementNameQuotedIfNeededpublic final java.lang.String keyspace
public final java.nio.ByteBuffer name
public UserType(java.lang.String keyspace,
java.nio.ByteBuffer name,
java.util.List<FieldIdentifier> fieldNames,
java.util.List<AbstractType<?>> fieldTypes,
boolean isMultiCell)
public static UserType getInstance(TypeParser parser)
public boolean isUDT()
isUDT in class AbstractType<java.nio.ByteBuffer>public boolean isMultiCell()
isMultiCell in class AbstractType<java.nio.ByteBuffer>public boolean isFreezable()
isFreezable in class AbstractType<java.nio.ByteBuffer>public AbstractType<?> fieldType(int i)
public java.util.List<AbstractType<?>> fieldTypes()
public FieldIdentifier fieldName(int i)
public java.lang.String fieldNameAsString(int i)
public java.util.List<FieldIdentifier> fieldNames()
public java.lang.String getNameAsString()
public int fieldPosition(FieldIdentifier fieldName)
public CellPath cellPathForField(FieldIdentifier fieldName)
public ShortType nameComparator()
public java.nio.ByteBuffer serializeForNativeProtocol(java.util.Iterator<Cell<?>> cells, ProtocolVersion protocolVersion)
public <V> void validateCell(Cell<V> cell) throws MarshalException
MarshalExceptionpublic Term fromJSONObject(java.lang.Object parsed) throws MarshalException
AbstractTypefromJSONObject in class TupleTypeparsed - the result of parsing a json stringMarshalExceptionpublic java.lang.String toJSONString(java.nio.ByteBuffer buffer,
ProtocolVersion protocolVersion)
AbstractTypeThe buffer position will stay the same.
toJSONString in class TupleTypebuffer - the value to convertprotocolVersion - the protocol version to use for the conversionpublic UserType freeze()
freeze in class AbstractType<java.nio.ByteBuffer>public AbstractType<?> freezeNestedMulticellTypes()
AbstractType2.x -> 3.x schema migrations, and can be removed in Cassandra 4.0.
See CASSANDRA-11609 and CASSANDRA-11613.freezeNestedMulticellTypes in class AbstractType<java.nio.ByteBuffer>public boolean isValueCompatibleWith(AbstractType<?> previous)
AbstractTypeisValueCompatibleWith in class AbstractType<java.nio.ByteBuffer>public boolean equals(java.lang.Object o)
public java.util.Optional<Difference> compare(UserType other)
public CQL3Type asCQL3Type()
asCQL3Type in class TupleTypepublic <V> boolean referencesUserType(V name,
ValueAccessor<V> accessor)
referencesUserType in class TupleTypepublic UserType withUpdatedUserType(UserType udt)
AbstractTypewithUpdatedUserType in class TupleTypepublic boolean referencesDuration()
referencesDuration in class TupleTypepublic java.lang.String toString()
AbstractTypepublic java.lang.String toString(boolean ignoreFreezing)
toString in class AbstractType<java.nio.ByteBuffer>ignoreFreezing - if true, the type string will not be wrapped with FrozenType(...), even if this type is frozen.public java.lang.String getCqlTypeName()
public TypeSerializer<java.nio.ByteBuffer> getSerializer()
getSerializer in class TupleTypepublic SchemaElement.SchemaElementType elementType()
SchemaElementelementType in interface SchemaElementpublic java.lang.String elementKeyspace()
SchemaElementelementKeyspace in interface SchemaElementpublic java.lang.String elementName()
SchemaElementelementName in interface SchemaElementpublic java.lang.String toCqlString(boolean withInternals,
boolean ifNotExists)
SchemaElementtoCqlString in interface SchemaElementwithInternals - if the internals part of the CQL should be exposed.ifNotExists - if "IF NOT EXISTS" should be included.Copyright © 2009-2020 The Apache Software Foundation