V - value type.public class Versioned<V> extends Object
| Constructor and Description |
|---|
Versioned(V value,
long version)
Constructs a new versioned value.
|
Versioned(V value,
long version,
long creationTime)
Constructs a new versioned value.
|
| Modifier and Type | Method and Description |
|---|---|
long |
creationTime()
Returns the system time when this version was created.
|
String |
toString() |
V |
value()
Returns the value.
|
long |
version()
Returns the version.
|
public Versioned(V value, long version, long creationTime)
value - valueversion - versioncreationTime - milliseconds of the creation event
from the Java epoch of 1970-01-01T00:00:00Zpublic Versioned(V value, long version)
value - valueversion - versionpublic V value()
public long version()
public long creationTime()
Care should be taken when relying on creationTime to implement any behavior in a distributed setting. Due to the possibility of clock skew it is likely that even creationTimes of causally related versions can be out or order.
Copyright © 2015. All rights reserved.