voldemort.versioning
Class Versioned<T>

java.lang.Object
  extended by 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

Nested Class Summary
static class Versioned.HappenedBeforeComparator<S>
           
 
Constructor Summary
Versioned(T object)
           
Versioned(T object, Version version)
           
 
Method Summary
 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.
 boolean equals(java.lang.Object o)
           
 T getValue()
           
 Version getVersion()
           
 int hashCode()
           
 void setObject(T object)
           
 java.lang.String toString()
           
static
<S> Versioned<S>
value(S s)
           
static
<S> Versioned<S>
value(S s, Version v)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Versioned

public Versioned(T object)

Versioned

public Versioned(T object,
                 Version version)
Method Detail

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