Package org.apache.cassandra.db.marshal
Class DurationType
- All Implemented Interfaces:
Comparator<ByteBuffer>,AssignmentTestable
Represents a duration. The duration is stored as months, days, and nanoseconds. This is done
Internally he duration is stored as months (unsigned integer), days (unsigned integer), and nanoseconds.
-
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
FieldsFields inherited from class org.apache.cassandra.db.marshal.AbstractType
comparatorSet, comparisonType, isByteOrderComparable, reverseComparator -
Method Summary
Modifier and TypeMethodDescriptionfromJSONObject(Object parsed) Given a parsed JSON string, return a byte representation of the object.fromString(String source) get a byte representation of the given string.booleanisValueCompatibleWithInternal(AbstractType<?> otherType) Needed to handle ReversedType in value-compatibility checks.booleanMethods inherited from class org.apache.cassandra.db.marshal.AbstractType
allowsEmpty, asComparableBytes, asComparableBytes, asCQLTypeStringList, checkComparable, compare, compare, compareCollectionMembers, compareCustom, compareForCQL, compose, compose, decompose, decomposeUntyped, expandUserTypes, freeze, freezeNestedMulticellTypes, fromComparableBytes, fromComparableBytes, getCompatibleTypeIfKnown, getComponents, getString, getString, getString, isCollection, isCompatibleWith, isCounter, isEmptyValueMeaningless, isFreezable, isFrozenCollection, isMultiCell, isNull, isNull, isReversed, isSerializationCompatibleWith, isTuple, isUDT, isValueCompatibleWith, isValueLengthFixed, isVector, parseDefaultParameters, read, readArray, readBuffer, readBuffer, referencesUserType, referencesUserType, skipValue, subTypes, testAssignment, testAssignment, toCQLString, toJSONString, toJSONString, toString, toString, udfType, unfreeze, unwrap, validate, 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
-
instance
-
-
Method Details
-
fromString
Description copied from class:AbstractTypeget a byte representation of the given string.- Specified by:
fromStringin classAbstractType<Duration>- Throws:
MarshalException
-
isValueCompatibleWithInternal
Description copied from class:AbstractTypeNeeded to handle ReversedType in value-compatibility checks. Subclasses should implement this instead of isValueCompatibleWith().- Overrides:
isValueCompatibleWithInternalin classAbstractType<Duration>
-
fromJSONObject
Description copied from class:AbstractTypeGiven a parsed JSON string, return a byte representation of the object.- Specified by:
fromJSONObjectin classAbstractType<Duration>- Parameters:
parsed- the result of parsing a json string- Throws:
MarshalException
-
getSerializer
- Specified by:
getSerializerin classAbstractType<Duration>
-
getArgumentDeserializer
- Overrides:
getArgumentDeserializerin classAbstractType<Duration>- Returns:
- the deserializer used to deserialize the function arguments of this type.
-
asCQL3Type
- Overrides:
asCQL3Typein classAbstractType<Duration>
-
referencesDuration
public boolean referencesDuration()- Overrides:
referencesDurationin classAbstractType<Duration>
-
getMaskedValue
- Overrides:
getMaskedValuein classAbstractType<Duration>- Returns:
- A fixed, serialized value to be used when the column is masked, to be returned instead of the real value.
-