voldemort.versioning
Class Versioned<T>
java.lang.Object
voldemort.versioning.Versioned<T>
- All Implemented Interfaces:
- java.io.Serializable
public final class Versioned<T>
- extends java.lang.Object
- implements java.io.Serializable
A wrapper for an object that adds a Version.
This class it bad to use in map, as the hashCode calls object.hashCode Most
likely the object is byte array and hashCode for array will be different for
different objects though the contents are the same
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Versioned
public Versioned(T object)
Versioned
public Versioned(T object,
Version version)
getVersion
public Version getVersion()
getValue
public T getValue()
setObject
public void setObject(T object)
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
cloneVersioned
public Versioned<T> cloneVersioned()
- Create a clone of this Versioned object such that the object pointed to
is the same, but the VectorClock and Versioned wrapper is a shallow copy.
value
public static <S> Versioned<S> value(S s)
value
public static <S> Versioned<S> value(S s,
Version v)
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu