Package ubic.gemma.model.common
Class AbstractIdentifiable
- java.lang.Object
-
- ubic.gemma.model.common.AbstractIdentifiable
-
- All Implemented Interfaces:
Identifiable
- Direct Known Subclasses:
AbstractDescribable
,AlternateName
,AuditEvent
,AuditEventType
,AuditTrail
,BibRefAnnotation
,BioAssayDimension
,BioSequence2GeneProduct
,Chromosome
,ChromosomeLocation
,CurationDetails
,DatabaseEntry
,DataVector
,Eigenvalue
,Eigenvector
,FactorValue
,Geeq
,Gene2GOAssociation
,GeneAlias
,GeneDifferentialExpressionMetaAnalysisResult
,GenericCellLevelCharacteristics
,GeneSetMember
,GroupAuthority
,HitListSize
,MeanVarianceRelation
,Measurement
,Multifunctionality
,ProbeLoading
,PvalueDistribution
,SampleCoexpressionMatrix
,SequenceSimilaritySearchResult
,SingleCellDimension
,Taxon
,Unit
public abstract class AbstractIdentifiable extends Object implements Identifiable
Base class for identifiable entities.Provide basics for holding the ID and rendering the object as a string and forces implementation to overrride hashCode() and equals().
- Author:
- poirigui
-
-
Constructor Summary
Constructors Constructor Description AbstractIdentifiable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
equals(Object object)
Important note: Two objects with the same class and non-null ID must be considered equal.Long
getId()
abstract int
hashCode()
Important note: Never use the ID in the hashCode() implementation since it can be assigned when the object is persisted.void
setId(Long id)
String
toString()
-
-
-
Method Detail
-
getId
public Long getId()
- Specified by:
getId
in interfaceIdentifiable
-
setId
public void setId(Long id)
-
hashCode
public abstract int hashCode()
Important note: Never use the ID in the hashCode() implementation since it can be assigned when the object is persisted.
-
equals
public abstract boolean equals(Object object)
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.
-
-