org.hl7.fhir.HumanName Maven / Gradle / Ivy
Show all versions of quick Show documentation
//
// This file was generated by the Eclipse Implementation of JAXB, v3.0.2
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2024.08.16 at 09:36:55 AM MDT
//
package org.hl7.fhir;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlType;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.HashCode2;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
/**
* If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions
*
* Java class for HumanName complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="HumanName">
* <complexContent>
* <extension base="{http://hl7.org/fhir}Element">
* <sequence>
* <element name="use" type="{http://hl7.org/fhir}NameUse" minOccurs="0"/>
* <element name="text" type="{http://hl7.org/fhir}string" minOccurs="0"/>
* <element name="family" type="{http://hl7.org/fhir}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="given" type="{http://hl7.org/fhir}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="prefix" type="{http://hl7.org/fhir}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="suffix" type="{http://hl7.org/fhir}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="period" type="{http://hl7.org/fhir}Period" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "HumanName", propOrder = {
"use",
"text",
"family",
"given",
"prefix",
"suffix",
"period"
})
public class HumanName
extends Element
implements Equals2, HashCode2, ToString2
{
protected NameUse use;
protected org.hl7.fhir.String text;
protected List family;
protected List given;
protected List prefix;
protected List suffix;
protected Period period;
/**
* Gets the value of the use property.
*
* @return
* possible object is
* {@link NameUse }
*
*/
public NameUse getUse() {
return use;
}
/**
* Sets the value of the use property.
*
* @param value
* allowed object is
* {@link NameUse }
*
*/
public void setUse(NameUse value) {
this.use = value;
}
/**
* Gets the value of the text property.
*
* @return
* possible object is
* {@link org.hl7.fhir.String }
*
*/
public org.hl7.fhir.String getText() {
return text;
}
/**
* Sets the value of the text property.
*
* @param value
* allowed object is
* {@link org.hl7.fhir.String }
*
*/
public void setText(org.hl7.fhir.String value) {
this.text = value;
}
/**
* Gets the value of the family property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a set
method for the family property.
*
*
* For example, to add a new item, do as follows:
*
* getFamily().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link org.hl7.fhir.String }
*
*
*/
public List getFamily() {
if (family == null) {
family = new ArrayList();
}
return this.family;
}
/**
* Gets the value of the given property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a set
method for the given property.
*
*
* For example, to add a new item, do as follows:
*
* getGiven().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link org.hl7.fhir.String }
*
*
*/
public List getGiven() {
if (given == null) {
given = new ArrayList();
}
return this.given;
}
/**
* Gets the value of the prefix property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a set
method for the prefix property.
*
*
* For example, to add a new item, do as follows:
*
* getPrefix().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link org.hl7.fhir.String }
*
*
*/
public List getPrefix() {
if (prefix == null) {
prefix = new ArrayList();
}
return this.prefix;
}
/**
* Gets the value of the suffix property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a set
method for the suffix property.
*
*
* For example, to add a new item, do as follows:
*
* getSuffix().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link org.hl7.fhir.String }
*
*
*/
public List getSuffix() {
if (suffix == null) {
suffix = new ArrayList();
}
return this.suffix;
}
/**
* Gets the value of the period property.
*
* @return
* possible object is
* {@link Period }
*
*/
public Period getPeriod() {
return period;
}
/**
* Sets the value of the period property.
*
* @param value
* allowed object is
* {@link Period }
*
*/
public void setPeriod(Period value) {
this.period = value;
}
public HumanName withUse(NameUse value) {
setUse(value);
return this;
}
public HumanName withText(org.hl7.fhir.String value) {
setText(value);
return this;
}
public HumanName withFamily(org.hl7.fhir.String... values) {
if (values!= null) {
for (org.hl7.fhir.String value: values) {
getFamily().add(value);
}
}
return this;
}
public HumanName withFamily(Collection values) {
if (values!= null) {
getFamily().addAll(values);
}
return this;
}
public HumanName withGiven(org.hl7.fhir.String... values) {
if (values!= null) {
for (org.hl7.fhir.String value: values) {
getGiven().add(value);
}
}
return this;
}
public HumanName withGiven(Collection values) {
if (values!= null) {
getGiven().addAll(values);
}
return this;
}
public HumanName withPrefix(org.hl7.fhir.String... values) {
if (values!= null) {
for (org.hl7.fhir.String value: values) {
getPrefix().add(value);
}
}
return this;
}
public HumanName withPrefix(Collection values) {
if (values!= null) {
getPrefix().addAll(values);
}
return this;
}
public HumanName withSuffix(org.hl7.fhir.String... values) {
if (values!= null) {
for (org.hl7.fhir.String value: values) {
getSuffix().add(value);
}
}
return this;
}
public HumanName withSuffix(Collection values) {
if (values!= null) {
getSuffix().addAll(values);
}
return this;
}
public HumanName withPeriod(Period value) {
setPeriod(value);
return this;
}
@Override
public HumanName withExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtension().add(value);
}
}
return this;
}
@Override
public HumanName withExtension(Collection values) {
if (values!= null) {
getExtension().addAll(values);
}
return this;
}
@Override
public HumanName withId(java.lang.String value) {
setId(value);
return this;
}
@Override
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
if (!super.equals(thisLocator, thatLocator, object, strategy)) {
return false;
}
final HumanName that = ((HumanName) object);
{
NameUse lhsUse;
lhsUse = this.getUse();
NameUse rhsUse;
rhsUse = that.getUse();
if (!strategy.equals(LocatorUtils.property(thisLocator, "use", lhsUse), LocatorUtils.property(thatLocator, "use", rhsUse), lhsUse, rhsUse, (this.use!= null), (that.use!= null))) {
return false;
}
}
{
org.hl7.fhir.String lhsText;
lhsText = this.getText();
org.hl7.fhir.String rhsText;
rhsText = that.getText();
if (!strategy.equals(LocatorUtils.property(thisLocator, "text", lhsText), LocatorUtils.property(thatLocator, "text", rhsText), lhsText, rhsText, (this.text!= null), (that.text!= null))) {
return false;
}
}
{
List lhsFamily;
lhsFamily = (((this.family!= null)&&(!this.family.isEmpty()))?this.getFamily():null);
List rhsFamily;
rhsFamily = (((that.family!= null)&&(!that.family.isEmpty()))?that.getFamily():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "family", lhsFamily), LocatorUtils.property(thatLocator, "family", rhsFamily), lhsFamily, rhsFamily, ((this.family!= null)&&(!this.family.isEmpty())), ((that.family!= null)&&(!that.family.isEmpty())))) {
return false;
}
}
{
List lhsGiven;
lhsGiven = (((this.given!= null)&&(!this.given.isEmpty()))?this.getGiven():null);
List rhsGiven;
rhsGiven = (((that.given!= null)&&(!that.given.isEmpty()))?that.getGiven():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "given", lhsGiven), LocatorUtils.property(thatLocator, "given", rhsGiven), lhsGiven, rhsGiven, ((this.given!= null)&&(!this.given.isEmpty())), ((that.given!= null)&&(!that.given.isEmpty())))) {
return false;
}
}
{
List lhsPrefix;
lhsPrefix = (((this.prefix!= null)&&(!this.prefix.isEmpty()))?this.getPrefix():null);
List rhsPrefix;
rhsPrefix = (((that.prefix!= null)&&(!that.prefix.isEmpty()))?that.getPrefix():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "prefix", lhsPrefix), LocatorUtils.property(thatLocator, "prefix", rhsPrefix), lhsPrefix, rhsPrefix, ((this.prefix!= null)&&(!this.prefix.isEmpty())), ((that.prefix!= null)&&(!that.prefix.isEmpty())))) {
return false;
}
}
{
List lhsSuffix;
lhsSuffix = (((this.suffix!= null)&&(!this.suffix.isEmpty()))?this.getSuffix():null);
List rhsSuffix;
rhsSuffix = (((that.suffix!= null)&&(!that.suffix.isEmpty()))?that.getSuffix():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "suffix", lhsSuffix), LocatorUtils.property(thatLocator, "suffix", rhsSuffix), lhsSuffix, rhsSuffix, ((this.suffix!= null)&&(!this.suffix.isEmpty())), ((that.suffix!= null)&&(!that.suffix.isEmpty())))) {
return false;
}
}
{
Period lhsPeriod;
lhsPeriod = this.getPeriod();
Period rhsPeriod;
rhsPeriod = that.getPeriod();
if (!strategy.equals(LocatorUtils.property(thisLocator, "period", lhsPeriod), LocatorUtils.property(thatLocator, "period", rhsPeriod), lhsPeriod, rhsPeriod, (this.period!= null), (that.period!= null))) {
return false;
}
}
return true;
}
@Override
public boolean equals(Object object) {
final EqualsStrategy2 strategy = JAXBEqualsStrategy.getInstance();
return equals(null, null, object, strategy);
}
@Override
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) {
int currentHashCode = super.hashCode(locator, strategy);
{
NameUse theUse;
theUse = this.getUse();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "use", theUse), currentHashCode, theUse, (this.use!= null));
}
{
org.hl7.fhir.String theText;
theText = this.getText();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "text", theText), currentHashCode, theText, (this.text!= null));
}
{
List theFamily;
theFamily = (((this.family!= null)&&(!this.family.isEmpty()))?this.getFamily():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "family", theFamily), currentHashCode, theFamily, ((this.family!= null)&&(!this.family.isEmpty())));
}
{
List theGiven;
theGiven = (((this.given!= null)&&(!this.given.isEmpty()))?this.getGiven():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "given", theGiven), currentHashCode, theGiven, ((this.given!= null)&&(!this.given.isEmpty())));
}
{
List thePrefix;
thePrefix = (((this.prefix!= null)&&(!this.prefix.isEmpty()))?this.getPrefix():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "prefix", thePrefix), currentHashCode, thePrefix, ((this.prefix!= null)&&(!this.prefix.isEmpty())));
}
{
List theSuffix;
theSuffix = (((this.suffix!= null)&&(!this.suffix.isEmpty()))?this.getSuffix():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "suffix", theSuffix), currentHashCode, theSuffix, ((this.suffix!= null)&&(!this.suffix.isEmpty())));
}
{
Period thePeriod;
thePeriod = this.getPeriod();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "period", thePeriod), currentHashCode, thePeriod, (this.period!= null));
}
return currentHashCode;
}
@Override
public int hashCode() {
final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.getInstance();
return this.hashCode(null, strategy);
}
@Override
public java.lang.String toString() {
final ToStringStrategy2 strategy = JAXBToStringStrategy.getInstance();
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
@Override
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
@Override
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
super.appendFields(locator, buffer, strategy);
{
NameUse theUse;
theUse = this.getUse();
strategy.appendField(locator, this, "use", buffer, theUse, (this.use!= null));
}
{
org.hl7.fhir.String theText;
theText = this.getText();
strategy.appendField(locator, this, "text", buffer, theText, (this.text!= null));
}
{
List theFamily;
theFamily = (((this.family!= null)&&(!this.family.isEmpty()))?this.getFamily():null);
strategy.appendField(locator, this, "family", buffer, theFamily, ((this.family!= null)&&(!this.family.isEmpty())));
}
{
List theGiven;
theGiven = (((this.given!= null)&&(!this.given.isEmpty()))?this.getGiven():null);
strategy.appendField(locator, this, "given", buffer, theGiven, ((this.given!= null)&&(!this.given.isEmpty())));
}
{
List thePrefix;
thePrefix = (((this.prefix!= null)&&(!this.prefix.isEmpty()))?this.getPrefix():null);
strategy.appendField(locator, this, "prefix", buffer, thePrefix, ((this.prefix!= null)&&(!this.prefix.isEmpty())));
}
{
List theSuffix;
theSuffix = (((this.suffix!= null)&&(!this.suffix.isEmpty()))?this.getSuffix():null);
strategy.appendField(locator, this, "suffix", buffer, theSuffix, ((this.suffix!= null)&&(!this.suffix.isEmpty())));
}
{
Period thePeriod;
thePeriod = this.getPeriod();
strategy.appendField(locator, this, "period", buffer, thePeriod, (this.period!= null));
}
return buffer;
}
public void setFamily(List value) {
this.family = value;
}
public void setGiven(List value) {
this.given = value;
}
public void setPrefix(List value) {
this.prefix = value;
}
public void setSuffix(List value) {
this.suffix = value;
}
}