net.ripe.rpki.commons.util
Class VersionedId

java.lang.Object
  extended by net.ripe.rpki.commons.util.VersionedId
All Implemented Interfaces:
Serializable

public class VersionedId
extends Object
implements Serializable

A versioned identifier to uniquely identify a specific version of an entity. This is used to implement optimistic locking.

See Also:
Serialized Form

Field Summary
static long INITIAL_VERSION
           
 
Constructor Summary
VersionedId(long id)
          Creates a versioned identifier with the initial version.
VersionedId(long id, long version)
           
 
Method Summary
 boolean equals(Object obj)
           
 long getId()
           
 long getVersion()
           
 int hashCode()
           
static VersionedId parse(String s)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INITIAL_VERSION

public static final long INITIAL_VERSION
See Also:
Constant Field Values
Constructor Detail

VersionedId

public VersionedId(long id)
Creates a versioned identifier with the initial version. Used when first creating an entity with a predefined id.


VersionedId

public VersionedId(long id,
                   long version)
Method Detail

getId

public long getId()

getVersion

public long getVersion()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

parse

public static VersionedId parse(String s)


Copyright © 2008-2013 RIPE NCC, the Netherlands. All Rights Reserved.