Package org.apache.cassandra.db.marshal
Class AbstractTimeUUIDType<T>
- java.lang.Object
-
- org.apache.cassandra.db.marshal.AbstractType<T>
-
- org.apache.cassandra.db.marshal.TemporalType<T>
-
- org.apache.cassandra.db.marshal.AbstractTimeUUIDType<T>
-
- All Implemented Interfaces:
java.util.Comparator<java.nio.ByteBuffer>,AssignmentTestable
- Direct Known Subclasses:
LegacyTimeUUIDType,TimeUUIDType
public abstract class AbstractTimeUUIDType<T> extends TemporalType<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.db.marshal.AbstractType
AbstractType.ComparisonType
-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResult
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.db.marshal.AbstractType
comparatorSet, comparisonType, isByteOrderComparable, reverseComparator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBufferaddDuration(java.nio.ByteBuffer temporal, java.nio.ByteBuffer duration)Adds the duration to the specified value.CQL3TypeasCQL3Type()<VL,VR>
intcompareCustom(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 semanticsjava.nio.ByteBufferdecomposeUntyped(java.lang.Object value)booleanequals(java.lang.Object obj)TermfromJSONObject(java.lang.Object parsed)Given a parsed JSON string, return a byte representation of the object.java.nio.ByteBufferfromString(java.lang.String source)get a byte representation of the given string.booleanisEmptyValueMeaningless()java.nio.ByteBuffernow()Returns the current temporal value.protected static longreorderTimestampBytes(long input)static longsignedBytesToNativeLong(long signedBytes)java.nio.ByteBuffersubstractDuration(java.nio.ByteBuffer temporal, java.nio.ByteBuffer duration)Substract the duration from the specified value.longtoTimeInMillis(java.nio.ByteBuffer value)Converts this temporal in UNIX timestamp.intvalueLengthIfFixed()The length of values for this type if all values are of fixed length, -1 otherwise.-
Methods inherited from class org.apache.cassandra.db.marshal.TemporalType
fromTimeInMillis, validateDuration
-
Methods inherited from class org.apache.cassandra.db.marshal.AbstractType
asCQLTypeStringList, checkComparable, compare, compare, compareCollectionMembers, compareForCQL, compose, compose, decompose, expandUserTypes, freeze, freezeNestedMulticellTypes, getComponents, getSerializer, getString, getString, getString, isCollection, isCompatibleWith, isCounter, isFreezable, isFrozenCollection, isMultiCell, isReversed, isSerializationCompatibleWith, isTuple, isUDT, isValueCompatibleWith, isValueCompatibleWithInternal, parseDefaultParameters, read, readArray, readBuffer, readBuffer, referencesDuration, referencesUserType, referencesUserType, skipValue, subTypes, testAssignment, testAssignment, toCQLString, toJSONString, toJSONString, toString, toString, udfType, unwrap, validate, validate, validateCellValue, validateCollectionMember, withUpdatedUserType, writeValue, writeValue, writtenLength, writtenLength
-
-
-
-
Method Detail
-
isEmptyValueMeaningless
public boolean isEmptyValueMeaningless()
Description copied from class:AbstractType- Overrides:
isEmptyValueMeaninglessin classAbstractType<T>
-
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<T>
-
signedBytesToNativeLong
public static long signedBytesToNativeLong(long signedBytes)
-
reorderTimestampBytes
protected static long reorderTimestampBytes(long input)
-
fromString
public java.nio.ByteBuffer fromString(java.lang.String source) throws MarshalExceptionDescription copied from class:AbstractTypeget a byte representation of the given string.- Specified by:
fromStringin classAbstractType<T>- Throws:
MarshalException
-
fromJSONObject
public Term fromJSONObject(java.lang.Object parsed) throws MarshalException
Description copied from class:AbstractTypeGiven a parsed JSON string, return a byte representation of the object.- Specified by:
fromJSONObjectin classAbstractType<T>- Parameters:
parsed- the result of parsing a json string- Throws:
MarshalException
-
asCQL3Type
public CQL3Type asCQL3Type()
- Overrides:
asCQL3Typein classAbstractType<T>
-
decomposeUntyped
public java.nio.ByteBuffer decomposeUntyped(java.lang.Object value)
- Overrides:
decomposeUntypedin classAbstractType<T>
-
valueLengthIfFixed
public int valueLengthIfFixed()
Description copied from class:AbstractTypeThe length of values for this type if all values are of fixed length, -1 otherwise.- Overrides:
valueLengthIfFixedin classAbstractType<T>
-
toTimeInMillis
public long toTimeInMillis(java.nio.ByteBuffer value)
Description copied from class:TemporalTypeConverts this temporal in UNIX timestamp.- Overrides:
toTimeInMillisin classTemporalType<T>- Parameters:
value- the temporal value.- Returns:
- the UNIX timestamp corresponding to this temporal.
-
addDuration
public java.nio.ByteBuffer addDuration(java.nio.ByteBuffer temporal, java.nio.ByteBuffer duration)Description copied from class:TemporalTypeAdds the duration to the specified value.- Overrides:
addDurationin classTemporalType<T>- Parameters:
temporal- the value to add toduration- the duration to add- Returns:
- the addition result
-
substractDuration
public java.nio.ByteBuffer substractDuration(java.nio.ByteBuffer temporal, java.nio.ByteBuffer duration)Description copied from class:TemporalTypeSubstract the duration from the specified value.- Overrides:
substractDurationin classTemporalType<T>- Parameters:
temporal- the value to substract fromduration- the duration to substract- Returns:
- the substracion result
-
now
public java.nio.ByteBuffer now()
Description copied from class:TemporalTypeReturns the current temporal value.- Overrides:
nowin classTemporalType<T>- Returns:
- the current temporal value.
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfacejava.util.Comparator<T>- Overrides:
equalsin classjava.lang.Object
-
-