Package com.globalmentor.model
Class DefaultIDNameDescriptioned<I,N extends java.lang.Comparable<N>,D>
- java.lang.Object
-
- com.globalmentor.model.DefaultIDed<I>
-
- com.globalmentor.model.DefaultIDNamed<I,N>
-
- com.globalmentor.model.DefaultIDNameDescriptioned<I,N,D>
-
public class DefaultIDNameDescriptioned<I,N extends java.lang.Comparable<N>,D> extends DefaultIDNamed<I,N>
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
Constructors Constructor Description DefaultIDNameDescriptioned(I id, N name, D description)
Constructor specifying the ID, name, and description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description D
getDescription()
protected void
setDescription(D description)
Sets the description of the object.java.lang.String
toString()
-
Methods inherited from class com.globalmentor.model.DefaultIDNamed
getName, setName
-
Methods inherited from class com.globalmentor.model.DefaultIDed
equals, getID, hashCode, setID
-
-
-
-
Constructor Detail
-
DefaultIDNameDescriptioned
public DefaultIDNameDescriptioned(I id, N name, D description)
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 Detail
-
getDescription
public D getDescription()
- Returns:
- The description of the object, or
null
if the object has no description.
-
setDescription
protected void setDescription(D description)
Sets the description of the object.- Parameters:
description
- The new description of the object, ornull
if the object should have no description.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classDefaultIDNamed<I,N extends java.lang.Comparable<N>>
- Returns:
- A string representation of this object in the format "objectinfo: [ID] name (description)".
-
-