com.virtuosotechnologies.lib.base
Class UniqueObject

java.lang.Object
  extended bycom.virtuosotechnologies.lib.base.UniqueObject
Direct Known Subclasses:
BasicEnumeratedType, PlatformEvent.Type, SearchBodyPredicateSemantics.PartConstraint, SearchParameters.PositionConstraint, UniqueClassConstrainedKey

public class UniqueObject
extends Object

An object whose equals() method is guaranteed to use reference equality. That is it does not equal any other object.

The description string is used for toString(). If you pass null for the description or do not provide one, UniqueObject will automatically generate a default string.


Constructor Summary
UniqueObject()
          Default constructor with no description.
UniqueObject(String description)
          Construct a UniqueObject with a description
 
Method Summary
 boolean equals(Object obj)
          Equals method.
 long getUniqueObjectID()
          Return a unique ID for this unique object.
 String toString()
          Return string description.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniqueObject

public UniqueObject()
Default constructor with no description. Causes toString() to return an automatically-generated default description string.


UniqueObject

public UniqueObject(String description)
Construct a UniqueObject with a description

Parameters:
description - description string for toString(). It is okay to pass null, in which case toString() will return an automatically-generated default string.
Method Detail

getUniqueObjectID

public final long getUniqueObjectID()
Return a unique ID for this unique object. Final.

Returns:
the unique id as a long integer

toString

public final String toString()
Return string description. Final so it cannot be overridden.


equals

public final boolean equals(Object obj)
Equals method. We make this final so it cannot be overridden, to enforce the contract that all UniqueObjects use reference equality.