org.almendra.commons.util.globalId
Class UniqueId

java.lang.Object
  extended by org.almendra.commons.util.globalId.UniqueId
All Implemented Interfaces:
java.io.Serializable

public class UniqueId
extends java.lang.Object
implements java.io.Serializable

Holds globally unique id as generated by UniqueIdGenerator.

Author:
Oliver Plohmann
See Also:
Serialized Form

Field Summary
protected  java.lang.String value
          Holds the value of the id as a string.
 
Constructor Summary
UniqueId(java.lang.String value)
          Creates a new UniqueId object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Answer whether two UniqueId objects are equal or not.
 java.lang.String getValue()
          Return the id as a string value.
 int hashCode()
          Return the hash of the id.
 java.lang.String toString()
          Print a UniqueId onto a string an return it.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected java.lang.String value
Holds the value of the id as a string.

Constructor Detail

UniqueId

public UniqueId(java.lang.String value)
Creates a new UniqueId object.

Parameters:
value - the id as a string
Method Detail

equals

public boolean equals(java.lang.Object obj)
Answer whether two UniqueId objects are equal or not.

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Print a UniqueId onto a string an return it.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getValue

public java.lang.String getValue()
Return the id as a string value.

Returns:

hashCode

public int hashCode()
Return the hash of the id.

Overrides:
hashCode in class java.lang.Object