gov.nih.nci.caarray.domain.vocabulary
Class Term

java.lang.Object
  extended by gov.nih.nci.caarray.domain.AbstractCaArrayObject
      extended by gov.nih.nci.caarray.domain.AbstractCaArrayEntity
          extended by gov.nih.nci.caarray.domain.vocabulary.Term
All Implemented Interfaces:
com.fiveamsolutions.nci.commons.data.persistent.PersistentObject, java.io.Serializable, java.lang.Comparable<Term>

@UniqueConstraints(constraints={@UniqueConstraint(fields={@UniqueConstraintField(name="value"),@UniqueConstraintField(name="source")}),@UniqueConstraint(fields={@UniqueConstraintField(name="accession"),@UniqueConstraintField(name="source")})},
                   message="{term.uniqueConstraint}")
public class Term
extends AbstractCaArrayEntity
implements java.lang.Comparable<Term>

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayEntity
CAARRAY_LSID_AUTHORITY, CAARRAY_LSID_NAMESPACE
 
Fields inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayObject
DEFAULT_BATCH_SIZE, DEFAULT_STRING_COLUMN_SIZE, LARGE_TEXT_FIELD_LENGTH
 
Constructor Summary
Term()
           
 
Method Summary
 int compareTo(Term o)
          
 boolean equals(java.lang.Object o)
          The default comparison uses the id.
 java.lang.String getAccession()
          Gets the accession, which is a unique identifier for this term within its term source.
 java.util.Set<Category> getCategories()
           
 java.lang.String getDescription()
          Gets the description.
 TermSource getSource()
          Gets the source.
 java.lang.String getUrl()
          Gets the url at which this term can be accessed, if available.
 java.lang.String getValue()
          Gets the value.
 java.lang.String getValueAndSource()
           
 int hashCode()
          Default hashCode goes off of id.
 void setAccession(java.lang.String accession)
          Sets the accession.
 void setCategory(Category category)
          Sets the categories of this term to be the singleton set with the given category.
 void setDescription(java.lang.String descriptionVal)
          Sets the description.
 void setSource(TermSource sourceVal)
          Sets the source.
 void setUrl(java.lang.String urlVal)
          Sets the url.
 void setValue(java.lang.String valueVal)
          Sets the value.
 
Methods inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayEntity
getLsid, getLsidAuthority, getLsidNamespace, getLsidObjectId, setLsid, setLsid, setLsidForEntity
 
Methods inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayObject
getCaBigId, getId, getPostLoadSecurityPolicies, getRemoteApiSecurityPolicies, setCaBigId, setId, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Term

public Term()
Method Detail

getDescription

@Length(max=254)
public java.lang.String getDescription()
Gets the description.

Returns:
the description

setDescription

public void setDescription(java.lang.String descriptionVal)
Sets the description.

Parameters:
descriptionVal - the description

getValue

@NotNull
@Length(min=1,
        max=254)
public java.lang.String getValue()
Gets the value.

Returns:
the value

setValue

public void setValue(java.lang.String valueVal)
Sets the value.

Parameters:
valueVal - the value

getUrl

public java.lang.String getUrl()
Gets the url at which this term can be accessed, if available.

Returns:
the url

setUrl

public void setUrl(java.lang.String urlVal)
Sets the url.

Parameters:
urlVal - the url

getAccession

public java.lang.String getAccession()
Gets the accession, which is a unique identifier for this term within its term source.

Returns:
the accession

setAccession

public void setAccession(java.lang.String accession)
Sets the accession.

Parameters:
accession - the accession

getCategories

public java.util.Set<Category> getCategories()
Returns:
the categories to which this term belongs

setCategory

public void setCategory(Category category)
Sets the categories of this term to be the singleton set with the given category.

Parameters:
category - the category which should be the sole category for this term

getSource

@NotNull(message="{term.source.notNull}")
public TermSource getSource()
Gets the source.

Returns:
the source

setSource

public void setSource(TermSource sourceVal)
Sets the source.

Parameters:
sourceVal - the source

getValueAndSource

public java.lang.String getValueAndSource()
Returns:
the value and the term source of this term, which identify the term unambiguously

equals

public boolean equals(java.lang.Object o)
The default comparison uses the id.

Overrides:
equals in class AbstractCaArrayObject
Parameters:
o - other object
Returns:
equal or not

hashCode

public int hashCode()
Default hashCode goes off of id.

Overrides:
hashCode in class AbstractCaArrayObject
Returns:
hashCode

compareTo

public int compareTo(Term o)

Specified by:
compareTo in interface java.lang.Comparable<Term>