Package com.globalmentor.model
Class DefaultNamed<N>
- java.lang.Object
-
- com.globalmentor.model.DefaultNamed<N>
-
- All Implemented Interfaces:
Named<N>
- Direct Known Subclasses:
DefaultComparableNamed
,NameValuePair
public class DefaultNamed<N> extends java.lang.Object implements Named<N>
A default implementation of a named object.- Author:
- Garret Wilson
-
-
Constructor Summary
Constructors Constructor Description DefaultNamed(N name)
Constructor specifying the name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
Compares the names of two objects if the other object is aNamed
.N
getName()
int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
DefaultNamed
public DefaultNamed(N name)
Constructor specifying the name.- Parameters:
name
- The object's new name, ornull
if the object has no name.
-
-
Method Detail
-
getName
public N getName()
-
equals
public boolean equals(java.lang.Object object)
Compares the names of two objects if the other object is aNamed
.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- A hashcode value composed from the name.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of this object's name.
-
-