org.hl7.fhir.Address 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.06.14 at 01:52:11 PM 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 Address complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="Address">
* <complexContent>
* <extension base="{http://hl7.org/fhir}Element">
* <sequence>
* <element name="use" type="{http://hl7.org/fhir}AddressUse" minOccurs="0"/>
* <element name="type" type="{http://hl7.org/fhir}AddressType" minOccurs="0"/>
* <element name="text" type="{http://hl7.org/fhir}string" minOccurs="0"/>
* <element name="line" type="{http://hl7.org/fhir}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="city" type="{http://hl7.org/fhir}string" minOccurs="0"/>
* <element name="district" type="{http://hl7.org/fhir}string" minOccurs="0"/>
* <element name="state" type="{http://hl7.org/fhir}string" minOccurs="0"/>
* <element name="postalCode" type="{http://hl7.org/fhir}string" minOccurs="0"/>
* <element name="country" type="{http://hl7.org/fhir}string" minOccurs="0"/>
* <element name="period" type="{http://hl7.org/fhir}Period" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Address", propOrder = {
"use",
"type",
"text",
"line",
"city",
"district",
"state",
"postalCode",
"country",
"period"
})
public class Address
extends Element
implements Equals2, HashCode2, ToString2
{
protected AddressUse use;
protected AddressType type;
protected org.hl7.fhir.String text;
protected List line;
protected org.hl7.fhir.String city;
protected org.hl7.fhir.String district;
protected org.hl7.fhir.String state;
protected org.hl7.fhir.String postalCode;
protected org.hl7.fhir.String country;
protected Period period;
/**
* Gets the value of the use property.
*
* @return
* possible object is
* {@link AddressUse }
*
*/
public AddressUse getUse() {
return use;
}
/**
* Sets the value of the use property.
*
* @param value
* allowed object is
* {@link AddressUse }
*
*/
public void setUse(AddressUse value) {
this.use = value;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link AddressType }
*
*/
public AddressType getType() {
return type;
}
/**
* Sets the value of the type property.
*
* @param value
* allowed object is
* {@link AddressType }
*
*/
public void setType(AddressType value) {
this.type = 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 line 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 line property.
*
*
* For example, to add a new item, do as follows:
*
* getLine().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link org.hl7.fhir.String }
*
*
*/
public List getLine() {
if (line == null) {
line = new ArrayList();
}
return this.line;
}
/**
* Gets the value of the city property.
*
* @return
* possible object is
* {@link org.hl7.fhir.String }
*
*/
public org.hl7.fhir.String getCity() {
return city;
}
/**
* Sets the value of the city property.
*
* @param value
* allowed object is
* {@link org.hl7.fhir.String }
*
*/
public void setCity(org.hl7.fhir.String value) {
this.city = value;
}
/**
* Gets the value of the district property.
*
* @return
* possible object is
* {@link org.hl7.fhir.String }
*
*/
public org.hl7.fhir.String getDistrict() {
return district;
}
/**
* Sets the value of the district property.
*
* @param value
* allowed object is
* {@link org.hl7.fhir.String }
*
*/
public void setDistrict(org.hl7.fhir.String value) {
this.district = value;
}
/**
* Gets the value of the state property.
*
* @return
* possible object is
* {@link org.hl7.fhir.String }
*
*/
public org.hl7.fhir.String getState() {
return state;
}
/**
* Sets the value of the state property.
*
* @param value
* allowed object is
* {@link org.hl7.fhir.String }
*
*/
public void setState(org.hl7.fhir.String value) {
this.state = value;
}
/**
* Gets the value of the postalCode property.
*
* @return
* possible object is
* {@link org.hl7.fhir.String }
*
*/
public org.hl7.fhir.String getPostalCode() {
return postalCode;
}
/**
* Sets the value of the postalCode property.
*
* @param value
* allowed object is
* {@link org.hl7.fhir.String }
*
*/
public void setPostalCode(org.hl7.fhir.String value) {
this.postalCode = value;
}
/**
* Gets the value of the country property.
*
* @return
* possible object is
* {@link org.hl7.fhir.String }
*
*/
public org.hl7.fhir.String getCountry() {
return country;
}
/**
* Sets the value of the country property.
*
* @param value
* allowed object is
* {@link org.hl7.fhir.String }
*
*/
public void setCountry(org.hl7.fhir.String value) {
this.country = value;
}
/**
* 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 Address withUse(AddressUse value) {
setUse(value);
return this;
}
public Address withType(AddressType value) {
setType(value);
return this;
}
public Address withText(org.hl7.fhir.String value) {
setText(value);
return this;
}
public Address withLine(org.hl7.fhir.String... values) {
if (values!= null) {
for (org.hl7.fhir.String value: values) {
getLine().add(value);
}
}
return this;
}
public Address withLine(Collection values) {
if (values!= null) {
getLine().addAll(values);
}
return this;
}
public Address withCity(org.hl7.fhir.String value) {
setCity(value);
return this;
}
public Address withDistrict(org.hl7.fhir.String value) {
setDistrict(value);
return this;
}
public Address withState(org.hl7.fhir.String value) {
setState(value);
return this;
}
public Address withPostalCode(org.hl7.fhir.String value) {
setPostalCode(value);
return this;
}
public Address withCountry(org.hl7.fhir.String value) {
setCountry(value);
return this;
}
public Address withPeriod(Period value) {
setPeriod(value);
return this;
}
@Override
public Address withExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtension().add(value);
}
}
return this;
}
@Override
public Address withExtension(Collection values) {
if (values!= null) {
getExtension().addAll(values);
}
return this;
}
@Override
public Address 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 Address that = ((Address) object);
{
AddressUse lhsUse;
lhsUse = this.getUse();
AddressUse 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;
}
}
{
AddressType lhsType;
lhsType = this.getType();
AddressType rhsType;
rhsType = that.getType();
if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType, (this.type!= null), (that.type!= 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 lhsLine;
lhsLine = (((this.line!= null)&&(!this.line.isEmpty()))?this.getLine():null);
List rhsLine;
rhsLine = (((that.line!= null)&&(!that.line.isEmpty()))?that.getLine():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "line", lhsLine), LocatorUtils.property(thatLocator, "line", rhsLine), lhsLine, rhsLine, ((this.line!= null)&&(!this.line.isEmpty())), ((that.line!= null)&&(!that.line.isEmpty())))) {
return false;
}
}
{
org.hl7.fhir.String lhsCity;
lhsCity = this.getCity();
org.hl7.fhir.String rhsCity;
rhsCity = that.getCity();
if (!strategy.equals(LocatorUtils.property(thisLocator, "city", lhsCity), LocatorUtils.property(thatLocator, "city", rhsCity), lhsCity, rhsCity, (this.city!= null), (that.city!= null))) {
return false;
}
}
{
org.hl7.fhir.String lhsDistrict;
lhsDistrict = this.getDistrict();
org.hl7.fhir.String rhsDistrict;
rhsDistrict = that.getDistrict();
if (!strategy.equals(LocatorUtils.property(thisLocator, "district", lhsDistrict), LocatorUtils.property(thatLocator, "district", rhsDistrict), lhsDistrict, rhsDistrict, (this.district!= null), (that.district!= null))) {
return false;
}
}
{
org.hl7.fhir.String lhsState;
lhsState = this.getState();
org.hl7.fhir.String rhsState;
rhsState = that.getState();
if (!strategy.equals(LocatorUtils.property(thisLocator, "state", lhsState), LocatorUtils.property(thatLocator, "state", rhsState), lhsState, rhsState, (this.state!= null), (that.state!= null))) {
return false;
}
}
{
org.hl7.fhir.String lhsPostalCode;
lhsPostalCode = this.getPostalCode();
org.hl7.fhir.String rhsPostalCode;
rhsPostalCode = that.getPostalCode();
if (!strategy.equals(LocatorUtils.property(thisLocator, "postalCode", lhsPostalCode), LocatorUtils.property(thatLocator, "postalCode", rhsPostalCode), lhsPostalCode, rhsPostalCode, (this.postalCode!= null), (that.postalCode!= null))) {
return false;
}
}
{
org.hl7.fhir.String lhsCountry;
lhsCountry = this.getCountry();
org.hl7.fhir.String rhsCountry;
rhsCountry = that.getCountry();
if (!strategy.equals(LocatorUtils.property(thisLocator, "country", lhsCountry), LocatorUtils.property(thatLocator, "country", rhsCountry), lhsCountry, rhsCountry, (this.country!= null), (that.country!= null))) {
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);
{
AddressUse theUse;
theUse = this.getUse();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "use", theUse), currentHashCode, theUse, (this.use!= null));
}
{
AddressType theType;
theType = this.getType();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType, (this.type!= null));
}
{
org.hl7.fhir.String theText;
theText = this.getText();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "text", theText), currentHashCode, theText, (this.text!= null));
}
{
List theLine;
theLine = (((this.line!= null)&&(!this.line.isEmpty()))?this.getLine():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "line", theLine), currentHashCode, theLine, ((this.line!= null)&&(!this.line.isEmpty())));
}
{
org.hl7.fhir.String theCity;
theCity = this.getCity();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "city", theCity), currentHashCode, theCity, (this.city!= null));
}
{
org.hl7.fhir.String theDistrict;
theDistrict = this.getDistrict();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "district", theDistrict), currentHashCode, theDistrict, (this.district!= null));
}
{
org.hl7.fhir.String theState;
theState = this.getState();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "state", theState), currentHashCode, theState, (this.state!= null));
}
{
org.hl7.fhir.String thePostalCode;
thePostalCode = this.getPostalCode();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "postalCode", thePostalCode), currentHashCode, thePostalCode, (this.postalCode!= null));
}
{
org.hl7.fhir.String theCountry;
theCountry = this.getCountry();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "country", theCountry), currentHashCode, theCountry, (this.country!= null));
}
{
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);
{
AddressUse theUse;
theUse = this.getUse();
strategy.appendField(locator, this, "use", buffer, theUse, (this.use!= null));
}
{
AddressType theType;
theType = this.getType();
strategy.appendField(locator, this, "type", buffer, theType, (this.type!= null));
}
{
org.hl7.fhir.String theText;
theText = this.getText();
strategy.appendField(locator, this, "text", buffer, theText, (this.text!= null));
}
{
List theLine;
theLine = (((this.line!= null)&&(!this.line.isEmpty()))?this.getLine():null);
strategy.appendField(locator, this, "line", buffer, theLine, ((this.line!= null)&&(!this.line.isEmpty())));
}
{
org.hl7.fhir.String theCity;
theCity = this.getCity();
strategy.appendField(locator, this, "city", buffer, theCity, (this.city!= null));
}
{
org.hl7.fhir.String theDistrict;
theDistrict = this.getDistrict();
strategy.appendField(locator, this, "district", buffer, theDistrict, (this.district!= null));
}
{
org.hl7.fhir.String theState;
theState = this.getState();
strategy.appendField(locator, this, "state", buffer, theState, (this.state!= null));
}
{
org.hl7.fhir.String thePostalCode;
thePostalCode = this.getPostalCode();
strategy.appendField(locator, this, "postalCode", buffer, thePostalCode, (this.postalCode!= null));
}
{
org.hl7.fhir.String theCountry;
theCountry = this.getCountry();
strategy.appendField(locator, this, "country", buffer, theCountry, (this.country!= null));
}
{
Period thePeriod;
thePeriod = this.getPeriod();
strategy.appendField(locator, this, "period", buffer, thePeriod, (this.period!= null));
}
return buffer;
}
public void setLine(List value) {
this.line = value;
}
}