Class DefaultIDNameDescriptioned<I,​N extends java.lang.Comparable<N>,​D>

  • All Implemented Interfaces:
    IDed<I>, Named<N>

    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 Detail

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

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