public class ImmutableTimestampValueImpl extends AbstractImmutableValue implements ImmutableExtensionValue, ImmutableTimestampValue
ImmutableTimestampValueImpl Implements ImmutableTimestampValue using a byte and a byte[] fields.TimestampValue| Modifier and Type | Field and Description |
|---|---|
private byte[] |
data |
private java.time.Instant |
instant |
| Constructor and Description |
|---|
ImmutableTimestampValueImpl(java.time.Instant timestamp) |
| Modifier and Type | Method and Description |
|---|---|
ImmutableExtensionValue |
asExtensionValue()
Returns the value as
ExtensionValue. |
ImmutableTimestampValue |
asTimestampValue()
Returns the value as
TimestampValue. |
boolean |
equals(java.lang.Object o)
Compares this value to the specified object.
|
byte[] |
getData() |
long |
getEpochSecond() |
int |
getNano() |
byte |
getType() |
ValueType |
getValueType()
Returns type of this value.
|
int |
hashCode() |
ImmutableTimestampValue |
immutableValue()
Returns immutable copy of this value.
|
boolean |
isTimestampValue()
Returns true if the type of this value is Timestamp.
|
long |
toEpochMillis() |
java.time.Instant |
toInstant() |
java.lang.String |
toJson()
Returns json representation of this Value.
|
java.lang.String |
toString() |
void |
writeTo(MessagePacker packer)
Serializes the value using the specified
MessagePacker |
asArrayValue, asBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitasNumberValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValueasArrayValue, asBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asRawValue, asStringValuepublic ImmutableTimestampValueImpl(java.time.Instant timestamp)
public boolean isTimestampValue()
ValueasTimestamp never throws exceptions.
Note that you can't use instanceof or cast ((MapValue) thisValue) to check type of a value because type of a mutable value is variable.isTimestampValue in interface ValueisTimestampValue in class AbstractImmutableValuepublic byte getType()
getType in interface ExtensionValuepublic ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType in interface Valuepublic ImmutableTimestampValue immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue in interface Valuepublic ImmutableExtensionValue asExtensionValue()
ValueExtensionValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((ExtensionValue) thisValue) to check type of a value
because type of a mutable value is variable.asExtensionValue in interface ValueasExtensionValue in class AbstractImmutableValuepublic ImmutableTimestampValue asTimestampValue()
ValueTimestampValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((TimestampValue) thisValue) to check type of a value because type of a mutable value is variable.asTimestampValue in interface ImmutableValueasTimestampValue in interface ValueasTimestampValue in class AbstractImmutableValuepublic byte[] getData()
getData in interface ExtensionValuepublic long getEpochSecond()
getEpochSecond in interface TimestampValuepublic int getNano()
getNano in interface TimestampValuepublic long toEpochMillis()
toEpochMillis in interface TimestampValuepublic java.time.Instant toInstant()
toInstant in interface TimestampValuepublic void writeTo(MessagePacker packer) throws java.io.IOException
ValueMessagePackerwriteTo in interface Valuejava.io.IOExceptionMessagePackerpublic boolean equals(java.lang.Object o)
Valuetrue if type and value are equivalent.
If this value is MapValue or ArrayValue, this method check equivalence of elements recursively.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toJson()
ValueFollowing behavior is not configurable at this release and they might be changed at future releases:
U+FFFD replacement character.U+FFFD replacement characterpublic java.lang.String toString()
toString in class java.lang.Object