@NotThreadSafe public class VersionedValue extends PointValue
This class extends PointValue
by adding a version for the value:
the time stamp in DateTime
format of the last modification time
(including creation). This is the representation used by TheStore to allow
"pull" requests.
Modifier and Type | Class and Description |
---|---|
static class |
VersionedValue.Deleted
Deleted.
|
static class |
VersionedValue.Factory
Factory.
|
static class |
VersionedValue.Purged
Purged.
|
PointValue.Null
Modifier and Type | Field and Description |
---|---|
static String |
VERSION_FIELD
Version field key.
|
NULL, POINT_FIELD, STAMP_FIELD, STATE_FIELD, UUID_FIELD, VALUE_FIELD
SERIALIZABLE_MODE, SIMPLE_STRING_MODE
Modifier | Constructor and Description |
---|---|
|
VersionedValue()
Constructs an instance.
|
|
VersionedValue(PointValue pointValue)
Constructs an instance from a point value.
|
protected |
VersionedValue(String point,
Optional<DateTime> stamp)
Constructs an instance.
|
protected |
VersionedValue(UUID uuid,
Optional<DateTime> stamp)
Constructs an instance.
|
|
VersionedValue(UUID uuid,
Optional<DateTime> stamp,
DateTime version,
Serializable state,
Serializable value)
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
VersionedValue |
copy()
Creates a copy of this point value.
|
boolean |
equals(Object other) |
VersionedValue |
frozen()
Returns a frozen instance of this.
|
protected String |
getStampString(DateTime.Context dateTimeContext)
Gets the time stamp string.
|
DateTime |
getVersion()
Gets this value's version.
|
int |
hashCode() |
static DateTime |
newVersion()
Returns a new version stamp.
|
void |
readExternal(ObjectInput input)
Reads in an external representation of this.
|
void |
readMap(Map<String,Serializable> map)
Reads a map of the fields.
|
protected void |
setVersion(DateTime version)
Sets this value's version.
|
VersionedValue |
thawed()
Returns a thawed instance of this.
|
void |
writeExternal(ObjectOutput output)
Writes out an external representation of this.
|
void |
writeMap(Map<String,Serializable> map)
Writes a map of the fields.
|
checkNotFrozen, clearStamp, confirm, copyValueFrom, decoded, denormalized, encoded, freeze, getNullablePoint, getPoint, getPointName, getPointUUID, getStamp, getState, getSynthesizedString, getThisLogger, getValue, hasPointUUID, hasStamp, isAbsent, isCacheable, isDeleted, isExtrapolated, isFrozen, isInterpolated, isNormalized, isPresent, isSynthesized, morph, morph, normalized, pointString, reset, restore, restore, sameValueAs, setFrozen, setPointName, setPointUUID, setStamp, setState, setValue, toDouble, toLong, toString, toString, updateStore, validate, valueString
public static final String VERSION_FIELD
public VersionedValue()
This is needed for an externalizable implementation.
public VersionedValue(PointValue pointValue)
pointValue
- The original point value.public VersionedValue(@Nonnull UUID uuid, @Nonnull Optional<DateTime> stamp, @Nonnull DateTime version, @Nullable Serializable state, @Nullable Serializable value)
uuid
- The UUID of the Point definition.stamp
- The optional time stamp of the value.version
- The version of the value.state
- The state.value
- The value.protected VersionedValue(@Nonnull String point, @Nonnull Optional<DateTime> stamp)
point
- A string identifying the point.stamp
- The optional time stamp of the value.@Nonnull @CheckReturnValue public static DateTime newVersion()
public VersionedValue copy()
copy
in class PointValue
public boolean equals(Object other)
equals
in class PointValue
public VersionedValue frozen()
frozen
in class PointValue
public DateTime getVersion()
getVersion
in class PointValue
public int hashCode()
hashCode
in class PointValue
public void readExternal(ObjectInput input) throws IOException
readExternal
in interface Externalizable
readExternal
in class PointValue
input
- The external representation.IOException
- When an I/O error occurs.public void readMap(Map<String,Serializable> map)
readMap
in interface Mappable
readMap
in class PointValue
map
- The source map.public VersionedValue thawed()
thawed
in class PointValue
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class PointValue
output
- The external representation.IOException
- When an I/O error occurs.public void writeMap(Map<String,Serializable> map)
writeMap
in interface Mappable
writeMap
in class PointValue
map
- The destination map.protected String getStampString(DateTime.Context dateTimeContext)
getStampString
in class PointValue
dateTimeContext
- The date-time context.protected void setVersion(DateTime version)
setVersion
in class PointValue
version
- The version.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.