Package com.globalmentor.model
Class DefaultIDNamed<I,N>
- java.lang.Object
-
- com.globalmentor.model.DefaultIDed<I>
-
- com.globalmentor.model.DefaultIDNamed<I,N>
-
- Direct Known Subclasses:
DefaultIDNameDescriptioned
public class DefaultIDNamed<I,N> extends DefaultIDed<I> implements Named<N>
A convenience class for storing an ID and a name. This class is useful to serve as a base class to other classes that are identified by an ID and a name.- Author:
- Garret Wilson
-
-
Constructor Summary
Constructors Constructor Description DefaultIDNamed(I id, N name)
Constructor specifying the ID and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description N
getName()
protected void
setName(N name)
Sets the name of the object.java.lang.String
toString()
-
Methods inherited from class com.globalmentor.model.DefaultIDed
equals, getID, hashCode, setID
-
-
-
-
Method Detail
-
getName
public N getName()
-
setName
protected void setName(N name)
Sets the name of the object.- Parameters:
name
- The new name of the object, ornull
if the object should have no name.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classDefaultIDed<I>
- Returns:
- A string representation of this object in the format "objectinfo: [ID] name".
-
-