de.smartics.exceptions.id
Class LongExceptionId

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

public class LongExceptionId
     
     
extends Object
implements ExceptionId< Long>

An implementation where the exception identifier is modeled as a long value.

See Also:
Serialized Form

Constructor Summary
LongExceptionId(long id)
          Default constructor that creates the identifier instance.
 
Method Summary
 boolean equals(Object object)
          Returns true if the given object is semantically equal to the given object, false otherwise.
 Long 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

LongExceptionId

public LongExceptionId(long id)
Default constructor that creates the identifier instance.

Parameters:
id - the value of the unique identifier.
Method Detail

getId

public Long getId()
Description copied from interface: ExceptionId
Returns the implementing type of the identifier.

Specified by:
getId in interface ExceptionId<Long>
Returns:
the implementing type of the identifier.

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<Long>
Overrides:
toString in class Object
Returns:
the UUID as a string.


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