Package com.globalmentor.model
Class DefaultIDNameDescriptioned<I,N extends Comparable<N>,D>
java.lang.Object
com.globalmentor.model.DefaultIDed<I>
com.globalmentor.model.DefaultIDNamed<I,N>
com.globalmentor.model.DefaultIDNameDescriptioned<I,N,D>
A convenience class for storing an ID, a name, and a description. Is useful to serve as a base class to other classes that are identified by an ID and have a
name and a description.
- Author:
- Garret Wilson
-
Constructor Summary
ConstructorDescriptionDefaultIDNameDescriptioned
(I id, N name, D description) Constructor specifying the ID, name, and description. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
setDescription
(D description) Sets the description of the object.toString()
Methods inherited from class com.globalmentor.model.DefaultIDNamed
getName, setName
Methods inherited from class com.globalmentor.model.DefaultIDed
equals, getID, hashCode, setID
-
Constructor Details
-
DefaultIDNameDescriptioned
Constructor specifying the ID, name, and description.- Parameters:
id
- The ID of the object, ornull
if the object should have no ID.name
- The name of the object, ornull
if the object should have no name.description
- The description of the object, ornull
if the object should have no description.
-
-
Method Details
-
getDescription
- Returns:
- The description of the object, or
null
if the object has no description.
-
setDescription
Sets the description of the object.- Parameters:
description
- The new description of the object, ornull
if the object should have no description.
-
toString
- Overrides:
toString
in classDefaultIDNamed<I,
N extends Comparable<N>> - Returns:
- A string representation of this object in the format "objectinfo: [ID] name (description)".
-