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>
All Implemented Interfaces:
IDed<I>, Named<N>

public class DefaultIDNameDescriptioned<I,N extends 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 Details

    • DefaultIDNameDescriptioned

      public DefaultIDNameDescriptioned(I id, N name, D description)
      Constructor specifying the ID, name, and description.
      Parameters:
      id - The ID of the object, or null if the object should have no ID.
      name - The name of the object, or null if the object should have no name.
      description - The description of the object, or null if the object should have no description.
  • Method Details

    • 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, or null if the object should have no description.
    • toString

      public String toString()
      Overrides:
      toString in class DefaultIDNamed<I,N extends Comparable<N>>
      Returns:
      A string representation of this object in the format "objectinfo: [ID] name (description)".