Package org.apache.cassandra.db.marshal
Class DynamicCompositeType.FixedValueComparator
java.lang.Object
org.apache.cassandra.db.marshal.AbstractType<Void>
org.apache.cassandra.db.marshal.DynamicCompositeType.FixedValueComparator
- All Implemented Interfaces:
Comparator<ByteBuffer>,AssignmentTestable
- Enclosing class:
- DynamicCompositeType
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cassandra.db.marshal.AbstractType
AbstractType.ComparisonType, AbstractType.DefaultArgumentDeserializerNested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResult -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DynamicCompositeType.FixedValueComparatorstatic final DynamicCompositeType.FixedValueComparatorFields inherited from class org.apache.cassandra.db.marshal.AbstractType
comparatorSet, comparisonType, isByteOrderComparable, reverseComparator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<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<V> Voidcompose(V value, ValueAccessor<V> accessor) fromJSONObject(Object parsed) Given a parsed JSON string, return a byte representation of the object.fromString(String str) get a byte representation of the given string.<V> StringgetString(V value, ValueAccessor<V> accessor) get a string representation of the bytes used for various identifier (NOT just for log messages)toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion) Converts the specified value into its JSON representation.voidvalidate(ByteBuffer bytes) Methods inherited from class org.apache.cassandra.db.marshal.AbstractType
allowsEmpty, asComparableBytes, asComparableBytes, asCQL3Type, asCQLTypeStringList, checkComparable, compare, compare, compareCollectionMembers, compareForCQL, compose, decomposeUntyped, expandUserTypes, freeze, freezeNestedMulticellTypes, fromComparableBytes, fromComparableBytes, getArgumentDeserializer, getCompatibleTypeIfKnown, getComponents, getMaskedValue, getString, getString, isCollection, isCompatibleWith, isCounter, isEmptyValueMeaningless, isFreezable, isFrozenCollection, isMultiCell, isNull, isNull, isReversed, isSerializationCompatibleWith, isTuple, isUDT, isValueCompatibleWith, isValueCompatibleWithInternal, isValueLengthFixed, isVector, parseDefaultParameters, read, readArray, readBuffer, readBuffer, referencesDuration, referencesUserType, referencesUserType, skipValue, subTypes, testAssignment, testAssignment, toCQLString, toJSONString, toString, toString, udfType, unfreeze, unwrap, validate, validateCellValue, validateCollectionMember, valueLengthIfFixed, withUpdatedUserType, writeValue, writeValue, writtenLength, writtenLengthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
alwaysLesserThan
-
alwaysGreaterThan
-
-
Constructor Details
-
FixedValueComparator
public FixedValueComparator(int cmp)
-
-
Method Details
-
compareCustom
public <VL,VR> int compareCustom(VL left, ValueAccessor<VL> accessorL, VR right, ValueAccessor<VR> accessorR) Description copied from class:AbstractTypeImplement 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- Overrides:
compareCustomin classAbstractType<Void>
-
compose
- Overrides:
composein classAbstractType<Void>
-
decompose
- Overrides:
decomposein classAbstractType<Void>
-
getString
Description copied from class:AbstractTypeget a string representation of the bytes used for various identifier (NOT just for log messages)- Overrides:
getStringin classAbstractType<Void>
-
fromString
Description copied from class:AbstractTypeget a byte representation of the given string.- Specified by:
fromStringin classAbstractType<Void>
-
fromJSONObject
Description copied from class:AbstractTypeGiven a parsed JSON string, return a byte representation of the object.- Specified by:
fromJSONObjectin classAbstractType<Void>- Parameters:
parsed- the result of parsing a json string
-
toJSONString
Description copied from class:AbstractTypeConverts the specified value into its JSON representation.The buffer position will stay the same.
- Overrides:
toJSONStringin classAbstractType<Void>- Parameters:
buffer- the value to convertprotocolVersion- the protocol version to use for the conversion- Returns:
- a JSON string representing the specified value
-
validate
- Overrides:
validatein classAbstractType<Void>
-
getSerializer
- Specified by:
getSerializerin classAbstractType<Void>
-