public class CompositeType extends AbstractCompositeType
AbstractCompositeType.ParsedComparator
AbstractType.ComparisonType
AssignmentTestable.TestResult
Modifier and Type | Field and Description |
---|---|
java.util.List<AbstractType<?>> |
types |
comparatorSet, comparisonType, isByteOrderComparable, reverseComparator
Modifier | Constructor and Description |
---|---|
protected |
CompositeType(java.util.List<AbstractType<?>> types) |
Modifier and Type | Method and Description |
---|---|
static <V> V |
build(ValueAccessor<V> accessor,
boolean isStatic,
V... values) |
static <V> V |
build(ValueAccessor<V> accessor,
V... values) |
java.nio.ByteBuffer |
decompose(java.lang.Object... objects) |
AbstractType<?> |
expandUserTypes()
Replace any instances of UserType with equivalent TupleType-s.
|
static java.nio.ByteBuffer |
extractComponent(java.nio.ByteBuffer bb,
int idx) |
protected <V> AbstractType<?> |
getAndAppendComparator(int i,
V value,
ValueAccessor<V> accessor,
java.lang.StringBuilder sb,
int offset)
Adds type information from @param bb to @param sb.
|
protected <VL,VR> AbstractType<?> |
getComparator(int i,
VL left,
ValueAccessor<VL> accessorL,
VR right,
ValueAccessor<VR> accessorR,
int offsetL,
int offsetR)
Adds DynamicCompositeType type information from @param bb1 to @param bb2.
|
protected <V> AbstractType<?> |
getComparator(int i,
V value,
ValueAccessor<V> accessor,
int offset) |
protected <V> int |
getComparatorSize(int i,
V value,
ValueAccessor<V> accessor,
int offset) |
java.util.List<AbstractType<?>> |
getComponents()
Return a list of the "subcomponents" this type has.
|
static CompositeType |
getInstance(AbstractType... types) |
static CompositeType |
getInstance(java.lang.Iterable<AbstractType<?>> types) |
static CompositeType |
getInstance(java.util.List<AbstractType<?>> types) |
static CompositeType |
getInstance(TypeParser parser) |
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.
|
static <V> boolean |
isStaticName(V value,
ValueAccessor<V> accessor) |
boolean |
isValueCompatibleWithInternal(AbstractType<?> otherType)
Needed to handle ReversedType in value-compatibility checks.
|
protected AbstractCompositeType.ParsedComparator |
parseComparator(int i,
java.lang.String part)
Used by fromString
|
protected <V> boolean |
readIsStatic(V value,
ValueAccessor<V> accessor) |
protected static <V> boolean |
readIsStaticInternal(V value,
ValueAccessor<V> accessor) |
<V> boolean |
referencesUserType(V name,
ValueAccessor<V> accessor) |
java.nio.ByteBuffer[] |
split(java.nio.ByteBuffer name)
Split a composite column names into it's components.
|
static <V> java.util.List<V> |
splitName(V name,
ValueAccessor<V> accessor) |
protected int |
startingOffset(boolean isStatic) |
protected static int |
startingOffsetInternal(boolean isStatic) |
java.lang.String |
toString()
This must be overriden by subclasses if necessary so that for any
AbstractType, this == TypeParser.parse(toString()).
|
protected <V> AbstractType<?> |
validateComparator(int i,
V value,
ValueAccessor<V> accessor,
int offset)
Like getComparator, but validates that @param i does not exceed the defined range
|
CompositeType |
withUpdatedUserType(UserType udt)
Returns an instance of this type with all references to the provided user type recursively replaced with its new
definition.
|
compareCustom, escape, fromJSONObject, fromString, getSerializer, getString, toJSONString, validate, validate
asCQL3Type, asCQLTypeStringList, checkComparable, compare, compare, compareCollectionMembers, compareForCQL, compose, compose, decompose, freeze, freezeNestedMulticellTypes, getString, getString, isCollection, isCounter, isEmptyValueMeaningless, isFreezable, isFrozenCollection, isMultiCell, isReversed, isTuple, isUDT, isValueCompatibleWith, parseDefaultParameters, read, readArray, readBuffer, readBuffer, referencesDuration, referencesUserType, skipValue, subTypes, testAssignment, testAssignment, toJSONString, toString, validateCellValue, validateCollectionMember, valueLengthIfFixed, writeValue, writeValue, writtenLength, writtenLength
public final java.util.List<AbstractType<?>> types
protected CompositeType(java.util.List<AbstractType<?>> types)
public static CompositeType getInstance(TypeParser parser) throws ConfigurationException, SyntaxException
public static CompositeType getInstance(java.lang.Iterable<AbstractType<?>> types)
public static CompositeType getInstance(AbstractType... types)
protected static int startingOffsetInternal(boolean isStatic)
protected int startingOffset(boolean isStatic)
startingOffset
in class AbstractCompositeType
protected static <V> boolean readIsStaticInternal(V value, ValueAccessor<V> accessor)
protected <V> boolean readIsStatic(V value, ValueAccessor<V> accessor)
readIsStatic
in class AbstractCompositeType
public static CompositeType getInstance(java.util.List<AbstractType<?>> types)
protected <V> AbstractType<?> getComparator(int i, V value, ValueAccessor<V> accessor, int offset)
getComparator
in class AbstractCompositeType
i
- DynamicCompositeType will read the type information from @param bbvalue
- name of type definitionprotected <VL,VR> AbstractType<?> getComparator(int i, VL left, ValueAccessor<VL> accessorL, VR right, ValueAccessor<VR> accessorR, int offsetL, int offsetR)
AbstractCompositeType
getComparator
in class AbstractCompositeType
i
- is ignored.protected <V> AbstractType<?> getAndAppendComparator(int i, V value, ValueAccessor<V> accessor, java.lang.StringBuilder sb, int offset)
AbstractCompositeType
getAndAppendComparator
in class AbstractCompositeType
protected AbstractCompositeType.ParsedComparator parseComparator(int i, java.lang.String part)
AbstractCompositeType
parseComparator
in class AbstractCompositeType
protected <V> AbstractType<?> validateComparator(int i, V value, ValueAccessor<V> accessor, int offset) throws MarshalException
AbstractCompositeType
validateComparator
in class AbstractCompositeType
MarshalException
protected <V> int getComparatorSize(int i, V value, ValueAccessor<V> accessor, int offset)
getComparatorSize
in class AbstractCompositeType
public java.nio.ByteBuffer decompose(java.lang.Object... objects)
decompose
in class AbstractCompositeType
public java.nio.ByteBuffer[] split(java.nio.ByteBuffer name)
AbstractCompositeType
split
in class AbstractCompositeType
public static <V> java.util.List<V> splitName(V name, ValueAccessor<V> accessor)
public static java.nio.ByteBuffer extractComponent(java.nio.ByteBuffer bb, int idx)
public static <V> boolean isStaticName(V value, ValueAccessor<V> accessor)
public java.util.List<AbstractType<?>> getComponents()
AbstractType
getComponents
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 <V> boolean referencesUserType(V name, ValueAccessor<V> accessor)
referencesUserType
in class AbstractType<java.nio.ByteBuffer>
public CompositeType withUpdatedUserType(UserType udt)
AbstractType
withUpdatedUserType
in class AbstractType<java.nio.ByteBuffer>
public AbstractType<?> expandUserTypes()
AbstractType
expandUserTypes
in class AbstractType<java.nio.ByteBuffer>
public java.lang.String toString()
AbstractType
toString
in class AbstractType<java.nio.ByteBuffer>
@SafeVarargs public static <V> V build(ValueAccessor<V> accessor, V... values)
@SafeVarargs public static <V> V build(ValueAccessor<V> accessor, boolean isStatic, V... values)
Copyright © 2009-2022 The Apache Software Foundation