public class TupleType extends AbstractType<java.nio.ByteBuffer>
AbstractType.ComparisonType
AssignmentTestable.TestResult
Modifier and Type | Field and Description |
---|---|
protected java.util.List<AbstractType<?>> |
types |
comparatorSet, comparisonType, isByteOrderComparable, reverseComparator
Modifier | Constructor and Description |
---|---|
|
TupleType(java.util.List<AbstractType<?>> types) |
protected |
TupleType(java.util.List<AbstractType<?>> types,
boolean freezeInner) |
Modifier and Type | Method and Description |
---|---|
java.util.List<AbstractType<?>> |
allTypes() |
CQL3Type |
asCQL3Type() |
static java.nio.ByteBuffer |
buildValue(java.nio.ByteBuffer[] components) |
static <V> V |
buildValue(ValueAccessor<V> accessor,
V[] components) |
<VL,VR> int |
compareCustom(VL left,
ValueAccessor<VL> accessorL,
VR right,
ValueAccessor<VR> accessorR)
Implement IFF ComparisonType is CUSTOM
Compares the byte representation of two instances of this class,
for types where this cannot be done by simple in-order comparison of the
unsigned bytes
Standard Java compare semantics
|
boolean |
equals(java.lang.Object o) |
AbstractType<?> |
expandUserTypes()
Replace any instances of UserType with equivalent TupleType-s.
|
Term |
fromJSONObject(java.lang.Object parsed)
Given a parsed JSON string, return a byte representation of the object.
|
java.nio.ByteBuffer |
fromString(java.lang.String source)
get a byte representation of the given string.
|
static TupleType |
getInstance(TypeParser parser) |
TypeSerializer<java.nio.ByteBuffer> |
getSerializer() |
<V> java.lang.String |
getString(V input,
ValueAccessor<V> accessor)
get a string representation of the bytes used for various identifier (NOT just for log messages)
|
int |
hashCode() |
boolean |
isCompatibleWith(AbstractType<?> previous)
Returns true if this comparator is compatible with the provided
previous comparator, that is if previous can safely be replaced by this.
|
boolean |
isTuple() |
boolean |
isValueCompatibleWithInternal(AbstractType<?> otherType)
Needed to handle ReversedType in value-compatibility checks.
|
boolean |
referencesDuration() |
<V> boolean |
referencesUserType(V name,
ValueAccessor<V> accessor) |
int |
size() |
java.nio.ByteBuffer[] |
split(java.nio.ByteBuffer value)
Split a tuple value into its component values.
|
java.util.List<AbstractType<?>> |
subTypes() |
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()).
|
AbstractType<?> |
type(int i) |
TupleType |
withUpdatedUserType(UserType udt)
Returns an instance of this type with all references to the provided user type recursively replaced with its new
definition.
|
asCQLTypeStringList, checkComparable, compare, compare, compareCollectionMembers, compareForCQL, compose, compose, decompose, freeze, freezeNestedMulticellTypes, getComponents, getString, getString, isCollection, isCounter, isEmptyValueMeaningless, isFreezable, isFrozenCollection, isMultiCell, isReversed, isUDT, isValueCompatibleWith, parseDefaultParameters, read, readArray, readBuffer, readBuffer, referencesUserType, skipValue, testAssignment, testAssignment, toJSONString, toString, validate, validate, validateCellValue, validateCollectionMember, valueLengthIfFixed, writeValue, writeValue, writtenLength, writtenLength
protected final java.util.List<AbstractType<?>> types
public TupleType(java.util.List<AbstractType<?>> types)
protected TupleType(java.util.List<AbstractType<?>> types, boolean freezeInner)
public static TupleType getInstance(TypeParser parser) throws ConfigurationException, SyntaxException
public <V> boolean referencesUserType(V name, ValueAccessor<V> accessor)
referencesUserType
in class AbstractType<java.nio.ByteBuffer>
public TupleType withUpdatedUserType(UserType udt)
AbstractType
withUpdatedUserType
in class AbstractType<java.nio.ByteBuffer>
public AbstractType<?> expandUserTypes()
AbstractType
expandUserTypes
in class AbstractType<java.nio.ByteBuffer>
public boolean referencesDuration()
referencesDuration
in class AbstractType<java.nio.ByteBuffer>
public AbstractType<?> type(int i)
public int size()
public java.util.List<AbstractType<?>> subTypes()
subTypes
in class AbstractType<java.nio.ByteBuffer>
public java.util.List<AbstractType<?>> allTypes()
public boolean isTuple()
isTuple
in class AbstractType<java.nio.ByteBuffer>
public <VL,VR> int compareCustom(VL left, ValueAccessor<VL> accessorL, VR right, ValueAccessor<VR> accessorR)
AbstractType
compareCustom
in class AbstractType<java.nio.ByteBuffer>
public java.nio.ByteBuffer[] split(java.nio.ByteBuffer value)
public static <V> V buildValue(ValueAccessor<V> accessor, V[] components)
public static java.nio.ByteBuffer buildValue(java.nio.ByteBuffer[] components)
public <V> java.lang.String getString(V input, ValueAccessor<V> accessor)
AbstractType
getString
in class AbstractType<java.nio.ByteBuffer>
public java.nio.ByteBuffer fromString(java.lang.String source)
AbstractType
fromString
in class AbstractType<java.nio.ByteBuffer>
public Term fromJSONObject(java.lang.Object parsed) throws MarshalException
AbstractType
fromJSONObject
in class AbstractType<java.nio.ByteBuffer>
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 AbstractType<java.nio.ByteBuffer>
buffer
- the value to convertprotocolVersion
- the protocol version to use for the conversionpublic TypeSerializer<java.nio.ByteBuffer> getSerializer()
getSerializer
in class AbstractType<java.nio.ByteBuffer>
public boolean isCompatibleWith(AbstractType<?> previous)
AbstractType
isCompatibleWith
in class AbstractType<java.nio.ByteBuffer>
public boolean isValueCompatibleWithInternal(AbstractType<?> otherType)
AbstractType
isValueCompatibleWithInternal
in class AbstractType<java.nio.ByteBuffer>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in interface java.util.Comparator<java.nio.ByteBuffer>
equals
in class java.lang.Object
public CQL3Type asCQL3Type()
asCQL3Type
in class AbstractType<java.nio.ByteBuffer>
public java.lang.String toString()
AbstractType
toString
in class AbstractType<java.nio.ByteBuffer>
Copyright © 2009-2022 The Apache Software Foundation