Class Characteristic
- All Implemented Interfaces:
Comparable<Characteristic>
,Describable
,Identifiable
- Direct Known Subclasses:
Statement
Characteristics can have an associated URI from an ontology from getCategoryUri()
and getValueUri()
,
but not necessarily since there might not be an adequate term to represent the conveyed concept. These properties are
marked with Nullable
and should always be handled with care.
- Author:
- Paul
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(Characteristic characteristic) boolean
Important note: Two objects with the same class and non-null ID must be considered equal.static Comparator
<Characteristic> Obtain a comparator to order terms by value URI (or value if null) in a case-insensitive manner.static Comparator
<Characteristic> Obtain a comparator to compare terms by category URI (or category if null) in a case-insensitive manner.static Comparator
<Characteristic> Obtain a full comparator for characteristics that fallbacks on the ID if everything else is equal.getId()
getValue()
int
hashCode()
Important note: Never use the ID in the hashCode() implementation since it can be assigned when the object is persisted.boolean
Deprecated.void
setCategory
(String category) void
setCategoryUri
(String categoryUri) void
setEvidenceCode
(GOEvidenceCode evidenceCode) void
setMigratedToStatement
(boolean migratedToStatement) Deprecated.void
setOriginalValue
(String originalValue) void
void
setValueUri
(String uri) toString()
Methods inherited from class ubic.gemma.model.common.AbstractDescribable
getDescription, getName, setDescription, setName
Methods inherited from class ubic.gemma.model.common.AbstractIdentifiable
setId
-
Constructor Details
-
Characteristic
public Characteristic()No-arg constructor added to satisfy javabean contract
-
-
Method Details
-
getComparator
Obtain a full comparator for characteristics that fallbacks on the ID if everything else is equal.The following fields are compared: category, value, ID.
-
getByCategoryComparator
Obtain a comparator to compare terms by category URI (or category if null) in a case-insensitive manner.Two terms that are equal in terms of category will be collapsed if using a
TreeSet
.Use this if you want to get a summary of the categories used by a collection of terms irrespective of their IDs.
-
getByCategoryAndValueComparator
Obtain a comparator to order terms by value URI (or value if null) in a case-insensitive manner.Two terms that are equal in terms of category and value (i.e. sharing the same ID) will be collapsed if using a
TreeSet
.Use this if you want to get a summary of the annotations used by a collection of terms irrespective of their IDs.
-
getId
- Specified by:
getId
in interfaceIdentifiable
- Overrides:
getId
in classAbstractIdentifiable
-
getCategory
- Returns:
- either the human readable form of the classUri or a free text version if no classUri exists
-
setCategory
-
getCategoryUri
- Returns:
- The URI of the class that this is an instance of. Will only be different from the termUri when the class is effectively abstract, and this is a concrete instance. By putting the abstract class URI in the object we can more readily group together Characteristics that are instances of the same class. For example: If the classUri is "Sex", then the termUri might be "male" or "female" for various instances. Otherwise, the classUri and the termUri can be the same; for example, for "Age", if the "Age" is defined through its properties declared as associations with this.
-
setCategoryUri
-
getEvidenceCode
-
setEvidenceCode
-
getOriginalValue
- Returns:
- the originalValue
-
setOriginalValue
-
getValue
- Returns:
- The human-readable term (e.g., "OrganismPart"; "kinase")
-
setValue
-
getValueUri
- Returns:
- This can be a URI to any resources that describes the characteristic. Often it might be a URI to an OWL ontology term. If the URI is an instance of an abstract class, the classUri should be filled in with the URI for the abstract class.
-
setValueUri
-
isMigratedToStatement
Deprecated. -
setMigratedToStatement
Deprecated. -
hashCode
public int hashCode()Description copied from class:AbstractIdentifiable
Important note: Never use the ID in the hashCode() implementation since it can be assigned when the object is persisted.- Overrides:
hashCode
in classAbstractDescribable
-
equals
Description copied from class:AbstractIdentifiable
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 classAbstractIdentifiable
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Characteristic>
-
toString
- Overrides:
toString
in classAbstractDescribable
-