org.sdnplatform.sync
Class Versioned<T>

java.lang.Object
  extended by org.sdnplatform.sync.Versioned<T>
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
VCVersioned

public class Versioned<T>
extends java.lang.Object
implements java.io.Serializable

A wrapper for an object that adds a Version.

See Also:
Serialized Form

Nested Class Summary
static class Versioned.HappenedBeforeComparator<S>
           
 
Constructor Summary
Versioned(T object)
           
Versioned(T object, IVersion 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.
static
<S> Versioned<S>
emptyVersioned()
           
 boolean equals(java.lang.Object o)
           
 T getValue()
           
 IVersion getVersion()
           
 int hashCode()
           
 void increment(int nodeId, long time)
           
 void setValue(T object)
           
 java.lang.String toString()
           
static
<S> Versioned<S>
value(S s)
           
static
<S> Versioned<S>
value(S s, IVersion 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,
                 IVersion version)
Method Detail

getVersion

public IVersion getVersion()

increment

public void increment(int nodeId,
                      long time)

getValue

public T getValue()

setValue

public void setValue(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,
                                     IVersion v)

emptyVersioned

public static <S> Versioned<S> emptyVersioned()