public class TimestampType extends TemporalType<java.util.Date>
AbstractType.ComparisonType
AssignmentTestable.TestResult
Modifier and Type | Field and Description |
---|---|
static TimestampType |
instance |
comparisonType, isByteOrderComparable, reverseComparator
Modifier and Type | Method and Description |
---|---|
CQL3Type |
asCQL3Type() |
int |
compareCustom(java.nio.ByteBuffer o1,
java.nio.ByteBuffer o2)
Implement IFF ComparisonType is CUSTOM
Compares the ByteBuffer 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
|
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.
|
java.nio.ByteBuffer |
fromTimeInMillis(long millis)
Returns the temporal value corresponding to the specified UNIX timestamp.
|
TypeSerializer<java.util.Date> |
getSerializer() |
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 |
isEmptyValueMeaningless()
|
boolean |
isValueCompatibleWithInternal(AbstractType<?> otherType)
Needed to handle ReversedType in value-compatibility checks.
|
java.lang.String |
toJSONString(java.nio.ByteBuffer buffer,
ProtocolVersion protocolVersion)
Converts the specified value into its JSON representation.
|
long |
toTimeInMillis(java.nio.ByteBuffer value)
Converts this temporal in UNIX timestamp.
|
protected void |
validateDuration(Duration duration)
Validates that the duration has the correct precision.
|
int |
valueLengthIfFixed()
The length of values for this type if all values are of fixed length, -1 otherwise.
|
addDuration, now, substractDuration
asCQLTypeStringList, checkComparable, compare, compareCollectionMembers, compareForCQL, componentsCount, compose, decompose, expandUserTypes, freeze, freezeNestedMulticellTypes, getComponents, getString, getString, isCollection, isCounter, isFreezable, isFrozenCollection, isMultiCell, isReversed, isTuple, isUDT, isValueCompatibleWith, parseDefaultParameters, readValue, readValue, referencesDuration, referencesUserType, skipValue, subTypes, testAssignment, testAssignment, toString, toString, validate, validateCellValue, validateCollectionMember, withUpdatedUserType, writeValue, writtenLength
public static final TimestampType instance
public boolean isEmptyValueMeaningless()
AbstractType
isEmptyValueMeaningless
in class AbstractType<java.util.Date>
public int compareCustom(java.nio.ByteBuffer o1, java.nio.ByteBuffer o2)
AbstractType
compareCustom
in class AbstractType<java.util.Date>
public java.nio.ByteBuffer fromString(java.lang.String source) throws MarshalException
AbstractType
fromString
in class AbstractType<java.util.Date>
MarshalException
public java.nio.ByteBuffer fromTimeInMillis(long millis) throws MarshalException
TemporalType
fromTimeInMillis
in class TemporalType<java.util.Date>
millis
- the UNIX timestamp to convertMarshalException
public long toTimeInMillis(java.nio.ByteBuffer value)
TemporalType
toTimeInMillis
in class TemporalType<java.util.Date>
value
- the temporal value.public Term fromJSONObject(java.lang.Object parsed) throws MarshalException
AbstractType
fromJSONObject
in class AbstractType<java.util.Date>
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.util.Date>
buffer
- the value to convertprotocolVersion
- the protocol version to use for the conversionpublic boolean isCompatibleWith(AbstractType<?> previous)
AbstractType
isCompatibleWith
in class AbstractType<java.util.Date>
public boolean isValueCompatibleWithInternal(AbstractType<?> otherType)
AbstractType
isValueCompatibleWithInternal
in class AbstractType<java.util.Date>
public CQL3Type asCQL3Type()
asCQL3Type
in class AbstractType<java.util.Date>
public TypeSerializer<java.util.Date> getSerializer()
getSerializer
in class AbstractType<java.util.Date>
public int valueLengthIfFixed()
AbstractType
valueLengthIfFixed
in class AbstractType<java.util.Date>
protected void validateDuration(Duration duration)
TemporalType
validateDuration
in class TemporalType<java.util.Date>
duration
- the duration to validate.Copyright © 2009-2020 The Apache Software Foundation