public class UserType extends TupleType
AbstractType.ComparisonType
AssignmentTestable.TestResult
Modifier and Type | Field and Description |
---|---|
java.lang.String |
keyspace |
java.nio.ByteBuffer |
name |
comparisonType, isByteOrderComparable, reverseComparator
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) |
boolean |
equals(java.lang.Object o) |
boolean |
equals(java.lang.Object o,
boolean ignoreFreezing)
Checks to see if two types are equal when ignoring or not ignoring differences in being frozen, depending on
the value of the ignoreFreezing parameter.
|
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.
|
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() |
boolean |
referencesUserType(java.lang.String userTypeName) |
java.nio.ByteBuffer |
serializeForNativeProtocol(java.util.Iterator<Cell> cells,
ProtocolVersion protocolVersion) |
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) |
void |
validateCell(Cell cell) |
allTypes, buildValue, compareCustom, fromString, getString, isCompatibleWith, isValueCompatibleWithInternal, size, split, type
asCQLTypeStringList, checkComparable, compare, compareCollectionMembers, compareForCQL, componentsCount, compose, decompose, getComponents, getString, isCollection, isCounter, isEmptyValueMeaningless, isFrozenCollection, isReversed, parseDefaultParameters, readValue, readValue, skipValue, testAssignment, validate, validateCellValue, validateCollectionMember, valueLengthIfFixed, writeValue, writtenLength
public 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) throws ConfigurationException, SyntaxException
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 void validateCell(Cell cell) throws MarshalException
MarshalException
public Term fromJSONObject(java.lang.Object parsed) throws MarshalException
AbstractType
fromJSONObject
in class TupleType
parsed
- the result of parsing a json stringMarshalException
public java.lang.String toJSONString(java.nio.ByteBuffer buffer, ProtocolVersion protocolVersion)
AbstractType
The buffer position will stay the same.
toJSONString
in class TupleType
buffer
- the value to convertprotocolVersion
- the protocol version to use for the conversionpublic UserType freeze()
freeze
in class AbstractType<java.nio.ByteBuffer>
public AbstractType<?> freezeNestedMulticellTypes()
AbstractType
2.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)
AbstractType
isValueCompatibleWith
in class AbstractType<java.nio.ByteBuffer>
public boolean equals(java.lang.Object o)
public boolean equals(java.lang.Object o, boolean ignoreFreezing)
AbstractType
equals
in class AbstractType<java.nio.ByteBuffer>
o
- type to compareignoreFreezing
- if true, differences in the types being frozen will be ignoredpublic CQL3Type asCQL3Type()
asCQL3Type
in class TupleType
public boolean referencesUserType(java.lang.String userTypeName)
referencesUserType
in class TupleType
public boolean referencesDuration()
referencesDuration
in class TupleType
public java.lang.String toString()
AbstractType
public 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 TypeSerializer<java.nio.ByteBuffer> getSerializer()
getSerializer
in class TupleType
Copyright © 2018 The Apache Software Foundation