|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.BaseOpenmrsObject
org.openmrs.BaseOpenmrsData
org.openmrs.PersonAttribute
public class PersonAttribute
A PersonAttribute is meant as way for implementations to add arbitrary information about a user/patient to their database. PersonAttributes are essentially just key-value pairs. However, the PersonAttributeType can be defined in such a way that the value portion of this PersonAttribute is a foreign key to another database table (like to the location table, or concept table). This gives a PersonAttribute the ability to link to any other part of the database A Person can have zero to n PersonAttribute(s).
PersonAttributeType,
Attributable,
Serialized Form| Field Summary | |
|---|---|
static long |
serialVersionUID
|
| Fields inherited from class org.openmrs.BaseOpenmrsData |
|---|
creator |
| Constructor Summary | |
|---|---|
PersonAttribute()
default constructor |
|
PersonAttribute(java.lang.Integer personAttributeId)
|
|
PersonAttribute(PersonAttributeType type,
java.lang.String value)
Constructor for creating a basic attribute |
|
| Method Summary | |
|---|---|
int |
compareTo(PersonAttribute other)
|
PersonAttribute |
copy()
Shallow copy of this PersonAttribute. |
protected PersonAttribute |
copyHelper(PersonAttribute target)
The purpose of this method is to allow subclasses of PersonAttribute to delegate a portion of their copy() method back to the superclass, in case the base class implementation changes. |
boolean |
equals(java.lang.Object obj)
Compares two objects for similarity |
boolean |
equalsContent(PersonAttribute otherAttribute)
Compares this PersonAttribute object to the given otherAttribute. |
PersonAttributeType |
getAttributeType()
|
java.lang.Object |
getHydratedObject()
Will try to create an object of class 'PersonAttributeType.format'. |
java.lang.Integer |
getId()
|
Person |
getPerson()
|
java.lang.Integer |
getPersonAttributeId()
|
java.lang.String |
getValue()
|
int |
hashCode()
|
void |
setAttributeType(PersonAttributeType attributeType)
|
void |
setId(java.lang.Integer id)
|
void |
setPerson(Person person)
|
void |
setPersonAttributeId(java.lang.Integer personAttributeId)
|
void |
setValue(java.lang.String value)
|
java.lang.String |
toString()
|
void |
voidAttribute(java.lang.String reason)
Convenience method for voiding this attribute |
| Methods inherited from class org.openmrs.BaseOpenmrsData |
|---|
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReason |
| Methods inherited from class org.openmrs.BaseOpenmrsObject |
|---|
getUuid, setUuid |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.openmrs.OpenmrsObject |
|---|
getUuid, setUuid |
| Field Detail |
|---|
public static final long serialVersionUID
| Constructor Detail |
|---|
public PersonAttribute()
public PersonAttribute(java.lang.Integer personAttributeId)
public PersonAttribute(PersonAttributeType type,
java.lang.String value)
type - PersonAttributeTypevalue - String| Method Detail |
|---|
public PersonAttribute copy()
thisprotected PersonAttribute copyHelper(PersonAttribute target)
target - a PersonAttribute that will have the state of this copied into it
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj -
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean equalsContent(PersonAttribute otherAttribute)
equals(Object) in that this method compares the inner fields of each attribute for
equality. Note: Null/empty fields on otherAttribute /will not/ cause a false
value to be returned
otherAttribute - PersonAttribute with which to compare
public Person getPerson()
public void setPerson(Person person)
person - The person to set.public PersonAttributeType getAttributeType()
public void setAttributeType(PersonAttributeType attributeType)
attributeType - the attributeType to setpublic java.lang.String getValue()
public void setValue(java.lang.String value)
value - the value to setpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public java.lang.Integer getPersonAttributeId()
public void setPersonAttributeId(java.lang.Integer personAttributeId)
personAttributeId - the personAttributeId to setpublic java.lang.Object getHydratedObject()
Attributable, hydrate(value) is called. Defaults to just returning getValue()
public void voidAttribute(java.lang.String reason)
reason - public int compareTo(PersonAttribute other)
compareTo in interface java.lang.Comparable<PersonAttribute>Comparable.compareTo(java.lang.Object)public java.lang.Integer getId()
getId in interface OpenmrsObjectOpenmrsObject.getId()public void setId(java.lang.Integer id)
setId in interface OpenmrsObjectid - - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
|
OpenMRS-1.7.x | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||