de.smartics.exceptions.id
Class UuidExceptionId

Package class diagram package UuidExceptionId
java.lang.Object
  extended by de.smartics.exceptions.id.UuidExceptionId
All Implemented Interfaces:
ExceptionId< UUID>, Serializable

public class UuidExceptionId
     
     
extends Object
implements ExceptionId< UUID>

An implementation where the exception identifier is modelled as an UUID.

Author:
Robert Reiner
See Also:
Serialized Form

Constructor Summary
UuidExceptionId()
          Constructor to create an instance with a random UUID.
UuidExceptionId(UUID uuid)
          Default constructor that creates an instance with the given UUID.
 
Method Summary
 boolean equals(Object object)
          Returns true if the given object is semantically equal to the given object, false otherwise.
 UUID getId()
          Returns the implementing type of the identifier.
 int hashCode()
          Returns the hashcode of the object.
 String toString()
          Returns the UUID as a string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UuidExceptionId

public UuidExceptionId()
Constructor to create an instance with a random UUID.


UuidExceptionId

public UuidExceptionId(UUID uuid)
Default constructor that creates an instance with the given UUID.

Parameters:
uuid - the unique identifier to use for an exception.
Method Detail

getId

public UUID getId()
Returns the implementing type of the identifier.

Specified by:
getId in interface ExceptionId<UUID>
Returns:
the implementing type of the identifier.
See Also:
ExceptionId.getId()

equals

public boolean equals(Object object)
Returns true if the given object is semantically equal to the given object, false otherwise.

Two instances o this class are equal if they have the same identifier.

Overrides:
equals in class Object
Parameters:
object - the instance to compare to.
Returns:
true if the given object is semantically equal to the given object, false otherwise.

hashCode

public int hashCode()
Returns the hashcode of the object.

It is the hashcode of the UUID instance.

Overrides:
hashCode in class Object
Returns:
the hash code.

toString

public String toString()
Returns the UUID as a string.

Specified by:
toString in interface ExceptionId<UUID>
Overrides:
toString in class Object
Returns:
the UUID as a string.
See Also:
Object.toString()


Copyright © 2007-null Kronseder & Reiner GmbH - smartics. All Rights Reserved.