@Indexed public class PersonName extends BaseChangeableOpenmrsData implements Serializable, Cloneable, Comparable<PersonName>
Modifier and Type | Class and Description |
---|---|
static class |
PersonName.DefaultComparator
Provides a default comparator.
|
Modifier and Type | Field and Description |
---|---|
static long |
serialVersionUID |
creator
Constructor and Description |
---|
PersonName()
default constructor
|
PersonName(Integer personNameId)
constructor with id
|
PersonName(String givenName,
String middleName,
String familyName)
Convenience constructor with the basic requirements
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PersonName other) |
boolean |
equalsContent(PersonName otherName)
Compares this PersonName object to the given otherName.
|
String |
getDegree() |
String |
getFamilyName() |
String |
getFamilyName2() |
String |
getFamilyNamePrefix() |
String |
getFamilyNameSuffix() |
static String |
getFormat() |
String |
getFullName()
Convenience method to get all the names of this PersonName and concatenating them together
with spaces in between.
|
String |
getGivenName() |
Integer |
getId() |
String |
getMiddleName() |
Person |
getPerson() |
Integer |
getPersonNameId() |
Boolean |
getPreferred() |
String |
getPrefix() |
Boolean |
isPreferred()
Deprecated.
as of 2.0, use
getPreferred() |
static PersonName |
newInstance(PersonName pn)
Bitwise copy of the personName object.
|
void |
setDegree(String degree) |
void |
setFamilyName(String familyName) |
void |
setFamilyName2(String familyName2) |
void |
setFamilyNamePrefix(String familyNamePrefix) |
void |
setFamilyNameSuffix(String familyNameSuffix) |
static void |
setFormat(String format) |
void |
setGivenName(String givenName) |
void |
setId(Integer id) |
void |
setMiddleName(String middleName) |
void |
setPerson(Person person) |
void |
setPersonNameId(Integer personNameId) |
void |
setPreferred(Boolean preferred) |
void |
setPrefix(String prefix) |
String |
toString()
Returns a string equal to the value of: ClassName{hashCode=...,
uuid=...}
|
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReason
equals, getUuid, hashCode, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public static final long serialVersionUID
public PersonName()
public PersonName(Integer personNameId)
public boolean equalsContent(PersonName otherName)
BaseOpenmrsObject.equals(Object)
in that this method compares the inner fields of each name for
equality. Note: Null/empty fields on otherName
/will not/ cause a false value to
be returnedotherName
- PersonName with which to comparepublic static PersonName newInstance(PersonName pn)
public String getDegree()
public void setDegree(String degree)
degree
- The degree to set.public String getFamilyName()
public void setFamilyName(String familyName)
familyName
- The familyName to set.public String getFamilyName2()
public void setFamilyName2(String familyName2)
familyName2
- The familyName2 to set.public String getFamilyNamePrefix()
public void setFamilyNamePrefix(String familyNamePrefix)
familyNamePrefix
- The familyNamePrefix to set.public String getFamilyNameSuffix()
public void setFamilyNameSuffix(String familyNameSuffix)
familyNameSuffix
- The familyNameSuffix to set.public String getGivenName()
public void setGivenName(String givenName)
givenName
- The givenName to set.public String getMiddleName()
public void setMiddleName(String middleName)
middleName
- The middleName to set.public Person getPerson()
public void setPerson(Person person)
person
- The person to set.public Integer getPersonNameId()
public void setPersonNameId(Integer personNameId)
personNameId
- The personNameId to set.@Deprecated public Boolean isPreferred()
getPreferred()
public Boolean getPreferred()
public void setPreferred(Boolean preferred)
preferred
- The preferred to set.public String getPrefix()
public void setPrefix(String prefix)
prefix
- The prefix to set.public String getFullName()
getPrefix()
, getGivenName()
,
getMiddleName()
, etc are null, they are not included in the returned namePersonName
joined with spaces
Should not put spaces around an empty middle namepublic String toString()
BaseOpenmrsObject
ClassName{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 BaseOpenmrsObject
Object.toString()
public Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public int compareTo(PersonName other)
compareTo
in interface Comparable<PersonName>
Should return negative if other name is voided
Should return negative if this name is preferred
Should return negative if other familyName is greater
Should return negative if other familyName2 is greater
Should return negative if other givenName is greater
Should return negative if other middleName is greater
Should return negative if other familynamePrefix is greater
Should return negative if other familyNameSuffix is greater
Should return negative if other dateCreated is greater
Note: this comparator imposes orderings that are inconsistent with equals.
public void setId(Integer id)
setId
in interface OpenmrsObject
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
public static void setFormat(String format)
public static String getFormat()
Copyright © 2024 OpenMRS Inc.. All rights reserved.