@Indexed public class PersonAttribute extends BaseChangeableOpenmrsData implements Serializable, Comparable<PersonAttribute>
PersonAttributeType,
Attributable,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
PersonAttribute.DefaultComparator
Provides a default comparator.
|
| Modifier and Type | Field and Description |
|---|---|
static long |
serialVersionUID |
creator| Constructor and Description |
|---|
PersonAttribute()
default constructor
|
PersonAttribute(Integer personAttributeId) |
PersonAttribute(PersonAttributeType type,
String value)
Constructor for creating a basic attribute
|
| Modifier and Type | Method and Description |
|---|---|
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 |
equalsContent(PersonAttribute otherAttribute)
Compares this PersonAttribute object to the given otherAttribute.
|
PersonAttributeType |
getAttributeType() |
Object |
getHydratedObject()
Will try to create an object of class 'PersonAttributeType.format'.
|
Integer |
getId() |
Person |
getPerson() |
Integer |
getPersonAttributeId() |
String |
getValue() |
void |
setAttributeType(PersonAttributeType attributeType) |
void |
setId(Integer id) |
void |
setPerson(Person person) |
void |
setPersonAttributeId(Integer personAttributeId) |
void |
setValue(String value) |
String |
toString()
Returns a string equal to the value of: ClassName{hashCode=...,
uuid=...}
|
void |
voidAttribute(String reason)
Convenience method for voiding this attribute
|
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReasonequals, getUuid, hashCode, setUuidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetUuid, setUuidpublic static final long serialVersionUID
public PersonAttribute()
public PersonAttribute(Integer personAttributeId)
public PersonAttribute(PersonAttributeType type, String value)
type - PersonAttributeTypevalue - Stringpublic PersonAttribute copy()
thisprotected PersonAttribute copyHelper(PersonAttribute target)
target - a PersonAttribute that will have the state of this copied into itpublic boolean equalsContent(PersonAttribute otherAttribute)
BaseOpenmrsObject.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 returnedotherAttribute - PersonAttribute with which to comparepublic 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 String getValue()
public void setValue(String value)
value - the value to setpublic String toString()
BaseOpenmrsObjectClassName{hashCode=..., uuid=...}
If the uuid field is null, it returns:
ClassName{hashCode=...}Should include hashCode if uuid is null Should include uuid if not null
toString in class BaseOpenmrsObjectShould return toString of hydrated valuepublic Integer getPersonAttributeId()
public void setPersonAttributeId(Integer personAttributeId)
personAttributeId - the personAttributeId to setpublic Object getHydratedObject()
Attributable, hydrate(value) is called. Defaults to just returning getValue()public void voidAttribute(String reason)
reason - Should set voided bit to truepublic int compareTo(PersonAttribute other)
compareTo in interface Comparable<PersonAttribute>Should return negative if other attribute is voided
Should return negative if other attribute has earlier date created
Should return negative if this attribute has lower attribute type than argument
Should return negative if other attribute has lower value
Should return negative if this attribute has lower attribute id than argument
Should not throw exception if attribute type is null
Note: this comparator imposes orderings that are inconsistent with equalspublic Integer getId()
getId in interface OpenmrsObjectOpenmrsObject.getId()public void setId(Integer id)
setId in interface OpenmrsObjectid - - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)Copyright © 2024 OpenMRS Inc.. All rights reserved.