org.openmrs
Class ConceptAnswer

java.lang.Object
  extended by org.openmrs.BaseOpenmrsObject
      extended by org.openmrs.ConceptAnswer
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ConceptAnswer>, Auditable, OpenmrsObject

public class ConceptAnswer
extends BaseOpenmrsObject
implements Auditable, java.io.Serializable, java.lang.Comparable<ConceptAnswer>

This class represents one option for an answer to a question type of Concept. The link to the parent question Concept is stored in getConcept() and the answer this object is representing is stored in getAnswerConcept().

See Also:
Concept.getAnswers(), Serialized Form

Field Summary
static long serialVersionUID
           
 
Constructor Summary
ConceptAnswer()
          default constructor
ConceptAnswer(Concept answerConcept)
           
ConceptAnswer(Concept answerConcept, Drug d)
           
ConceptAnswer(java.lang.Integer conceptAnswerId)
          constructor with id
 
Method Summary
 int compareTo(ConceptAnswer ca)
           
 boolean equals(java.lang.Object obj)
           
 Concept getAnswerConcept()
           
 Drug getAnswerDrug()
           
 User getChangedBy()
          Not currently used.
 Concept getConcept()
           
 java.lang.Integer getConceptAnswerId()
           
 User getCreator()
           
 java.util.Date getDateChanged()
          Not currently used.
 java.util.Date getDateCreated()
           
 java.lang.Integer getId()
           
 java.lang.Double getSortWeight()
           
 int hashCode()
           
 void setAnswerConcept(Concept answerConcept)
           
 void setAnswerDrug(Drug answerDrug)
           
 void setChangedBy(User changedBy)
          Not currently used.
 void setConcept(Concept concept)
           
 void setConceptAnswerId(java.lang.Integer conceptAnswerId)
           
 void setCreator(User creator)
           
 void setDateChanged(java.util.Date dateChanged)
          Not currently used.
 void setDateCreated(java.util.Date dateCreated)
           
 void setId(java.lang.Integer id)
           
 void setSortWeight(java.lang.Double sortWeight)
           
 
Methods inherited from class org.openmrs.BaseOpenmrsObject
getUuid, setUuid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmrs.OpenmrsObject
getUuid, setUuid
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ConceptAnswer

public ConceptAnswer()
default constructor


ConceptAnswer

public ConceptAnswer(java.lang.Integer conceptAnswerId)
constructor with id


ConceptAnswer

public ConceptAnswer(Concept answerConcept)

ConceptAnswer

public ConceptAnswer(Concept answerConcept,
                     Drug d)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)
Expected behavior:
not return true given an object with just a null drug answer

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getAnswerConcept

public Concept getAnswerConcept()
Returns:
Returns the answerConcept.

setAnswerConcept

public void setAnswerConcept(Concept answerConcept)
Parameters:
answerConcept - The answerConcept to set.

getAnswerDrug

public Drug getAnswerDrug()
Returns:
Returns the answerDrug.

setAnswerDrug

public void setAnswerDrug(Drug answerDrug)
Parameters:
answerDrug - The answerDrug to set.

getConcept

public Concept getConcept()
Returns:
Returns the concept.

setConcept

public void setConcept(Concept concept)
Parameters:
concept - The concept to set.

getConceptAnswerId

public java.lang.Integer getConceptAnswerId()
Returns:
Returns the conceptAnswerId.

setConceptAnswerId

public void setConceptAnswerId(java.lang.Integer conceptAnswerId)
Parameters:
conceptAnswerId - The conceptAnswerId to set.

getCreator

public User getCreator()
Specified by:
getCreator in interface Auditable
Returns:
Returns the creator.

setCreator

public void setCreator(User creator)
Specified by:
setCreator in interface Auditable
Parameters:
creator - The creator to set.

getDateCreated

public java.util.Date getDateCreated()
Specified by:
getDateCreated in interface Auditable
Returns:
Returns the dateCreated.

setDateCreated

public void setDateCreated(java.util.Date dateCreated)
Specified by:
setDateCreated in interface Auditable
Parameters:
dateCreated - The dateCreated to set.

getId

public java.lang.Integer getId()
Specified by:
getId in interface OpenmrsObject
Returns:
id - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.getId()

setId

public void setId(java.lang.Integer id)
Specified by:
setId in interface OpenmrsObject
Parameters:
id - - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.setId(java.lang.Integer)

getChangedBy

public User getChangedBy()
Not currently used. Always returns null.

Specified by:
getChangedBy in interface Auditable
Returns:
User - the user who last changed the object
See Also:
Auditable.getChangedBy()

getDateChanged

public java.util.Date getDateChanged()
Not currently used. Always returns null.

Specified by:
getDateChanged in interface Auditable
Returns:
Date - the date the object was last changed
See Also:
Auditable.getDateChanged()

setChangedBy

public void setChangedBy(User changedBy)
Not currently used.

Specified by:
setChangedBy in interface Auditable
Parameters:
changedBy - - the user who last changed the object
See Also:
Auditable.setChangedBy(org.openmrs.User)

setDateChanged

public void setDateChanged(java.util.Date dateChanged)
Not currently used.

Specified by:
setDateChanged in interface Auditable
Parameters:
dateChanged - - the date the object was last changed
See Also:
Auditable.setDateChanged(java.util.Date)

getSortWeight

public java.lang.Double getSortWeight()
Returns:
Returns the sortWeight.

setSortWeight

public void setSortWeight(java.lang.Double sortWeight)
Parameters:
sortWeight - The sortWeight to set.

compareTo

public int compareTo(ConceptAnswer ca)
Specified by:
compareTo in interface java.lang.Comparable<ConceptAnswer>
See Also:
Comparable.compareTo(java.lang.Object)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change