@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_FIELDSERIALIZABLE_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, valueStringpublic 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 PointValuepublic boolean equals(Object other)
equals in class PointValuepublic VersionedValue frozen()
frozen in class PointValuepublic DateTime getVersion()
getVersion in class PointValuepublic int hashCode()
hashCode in class PointValuepublic void readExternal(ObjectInput input)
throws IOException
readExternal in interface ExternalizablereadExternal in class PointValueinput - The external representation.IOException - When an I/O error occurs.public void readMap(Map<String,Serializable> map)
readMap in interface MappablereadMap in class PointValuemap - The source map.public VersionedValue thawed()
thawed in class PointValuepublic void writeExternal(ObjectOutput output)
throws IOException
writeExternal in interface ExternalizablewriteExternal in class PointValueoutput - The external representation.IOException - When an I/O error occurs.public void writeMap(Map<String,Serializable> map)
writeMap in interface MappablewriteMap in class PointValuemap - The destination map.protected String getStampString(DateTime.Context dateTimeContext)
getStampString in class PointValuedateTimeContext - The date-time context.protected void setVersion(DateTime version)
setVersion in class PointValueversion - The version.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.