public class PersonAttribute extends BaseOpenmrsData implements Serializable, Comparable<PersonAttribute>
PersonAttributeType
,
Attributable
,
Serialized FormModifier 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 |
equals(Object obj)
Compares two objects for similarity
|
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() |
int |
hashCode() |
void |
setAttributeType(PersonAttributeType attributeType) |
void |
setId(Integer id) |
void |
setPerson(Person person) |
void |
setPersonAttributeId(Integer personAttributeId) |
void |
setValue(String value) |
String |
toString() |
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, setVoidReason
getUuid, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public static final long serialVersionUID
public PersonAttribute()
public PersonAttribute(Integer personAttributeId)
public PersonAttribute(PersonAttributeType type, String value)
type
- PersonAttributeTypevalue
- Stringpublic PersonAttribute copy()
this
protected PersonAttribute copyHelper(PersonAttribute target)
target
- a PersonAttribute that will have the state of this
copied into itpublic boolean equals(Object obj)
public int hashCode()
hashCode
in class Object
Object.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 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()
toString
in class Object
Object.toString()
public 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
- public int compareTo(PersonAttribute other)
compareTo
in interface Comparable<PersonAttribute>
Comparable.compareTo(java.lang.Object)
public Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public void setId(Integer id)
setId
in interface OpenmrsObject
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.