Class AbstractDescribable

java.lang.Object
ubic.gemma.model.common.AbstractIdentifiable
ubic.gemma.model.common.AbstractDescribable
All Implemented Interfaces:
Describable, Identifiable
Direct Known Subclasses:
AbstractAuditable, Analysis, BibliographicReference, BioAssay, BioMaterial, BioSequence, BlacklistedEntity, Characteristic, ChromosomeFeature, CompositeSequence, Compound, Contact, ExperimentalDesign, ExperimentalFactor, ExternalDatabase, GenericCellLevelCharacteristics, Protocol, QuantitationType, Reporter, Treatment

public abstract class AbstractDescribable extends AbstractIdentifiable implements Describable
  • Constructor Details

    • AbstractDescribable

      public AbstractDescribable()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Describable
      Obtain the name of the object.

      It may be human-readable.

      It is case-insensitive and usually unique within a certain context (e.g. in a collection).

      It is non-null by default, but implementation may override this with a Nullable annotation. If null, it should not be treated as equal to other Describable objects (i.e. there can be multiple null-named describable within a given set).

      Specified by:
      getName in interface Describable
    • setName

      public void setName(String name)
    • getDescription

      @Nullable public String getDescription()
      Description copied from interface: Describable
      Obtain a human-readable description of the object
      Specified by:
      getDescription in interface Describable
    • setDescription

      public void setDescription(@Nullable String description)
    • hashCode

      public int hashCode()
      The default hash code for a describable is based on its name, ignoring case.

      Important note: Never use the ID in the hashCode() implementation since it can be assigned when the object is persisted.

      Specified by:
      hashCode in class AbstractIdentifiable
    • equals

      public abstract boolean equals(Object object)
      Important note: The name should be compared in a case-insensitive manner. You can use DescribableUtils.equalsByName(Describable, Describable) to get the correct behavior.

      Important note: Two objects with the same class and non-null ID must be considered equal. If one or both IDs are nulls, the rest of the state can be used to determine equality.

      Specified by:
      equals in class AbstractIdentifiable
    • toString

      public String toString()
      Overrides:
      toString in class AbstractIdentifiable