Package ubic.gemma.model.common
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanImportant note: The name should be compared in a case-insensitive manner.Obtain a human-readable description of the objectgetName()Obtain the name of the object.inthashCode()The default hash code for a describable is based on its name, ignoring case.voidsetDescription(String description) voidtoString()Methods inherited from class ubic.gemma.model.common.AbstractIdentifiable
getId, setIdMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ubic.gemma.model.common.Identifiable
getId
-
Constructor Details
-
AbstractDescribable
public AbstractDescribable()
-
-
Method Details
-
getName
Description copied from interface:DescribableObtain 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
Nullableannotation. If null, it should not be treated as equal to otherDescribableobjects (i.e. there can be multiple null-named describable within a given set).- Specified by:
getNamein interfaceDescribable
-
setName
-
getDescription
Description copied from interface:DescribableObtain a human-readable description of the object- Specified by:
getDescriptionin interfaceDescribable
-
setDescription
-
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:
hashCodein classAbstractIdentifiable
-
equals
Important note: The name should be compared in a case-insensitive manner. You can useDescribableUtils.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:
equalsin classAbstractIdentifiable
-
toString
- Overrides:
toStringin classAbstractIdentifiable
-