Package com.globalmentor.model
Class DefaultIDed<I>
java.lang.Object
com.globalmentor.model.DefaultIDed<I>
- All Implemented Interfaces:
IDed<I>
- Direct Known Subclasses:
AbstractPrincipal
,DefaultIDNamed
A default implementation of a uniquely identified object. This class is useful to serve as a base class to other classes that are identified by an ID. It
provides equality checking based upon the ID.
This implementation provides the capability to provide automatic conversion of the ID when the ID is set, such as converting to lowercase.
- Author:
- Garret Wilson
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
DefaultIDed
Constructor specifying the ID.- Parameters:
id
- The ID of the object.
-
-
Method Details
-
getID
-
setID
Sets the identifier of the object.- Parameters:
id
- The identifier, preferably unique, of the object; ornull
if the object has no ID.
-
equals
Considers another object equal if the other object is anIDed
with the same ID. -
hashCode
public int hashCode() -
toString
-