org.hl7.fhir.Protocol 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: 2023.12.06 at 03:09:41 PM MST
//
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.XmlElement;
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 either a @value, an @id, or extensions
*
* Java class for Protocol complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="Protocol">
* <complexContent>
* <extension base="{http://hl7.org/fhir}DomainResource">
* <sequence>
* <element name="identifier" type="{http://hl7.org/fhir}Identifier" maxOccurs="unbounded" minOccurs="0"/>
* <element name="title" type="{http://hl7.org/fhir}string" minOccurs="0"/>
* <element name="status" type="{http://hl7.org/fhir}ProtocolStatus"/>
* <element name="type" type="{http://hl7.org/fhir}ProtocolType"/>
* <element name="subject" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <element name="group" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <element name="purpose" type="{http://hl7.org/fhir}string"/>
* <element name="author" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <element name="step" type="{http://hl7.org/fhir}Protocol.Step" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Protocol", propOrder = {
"identifier",
"title",
"status",
"type",
"subject",
"group",
"purpose",
"author",
"step"
})
public class Protocol
extends DomainResource
implements Equals2, HashCode2, ToString2
{
protected List identifier;
protected org.hl7.fhir.String title;
@XmlElement(required = true)
protected ProtocolStatus status;
@XmlElement(required = true)
protected ProtocolType type;
protected Reference subject;
protected Reference group;
@XmlElement(required = true)
protected org.hl7.fhir.String purpose;
protected Reference author;
protected List step;
/**
* Gets the value of the identifier 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 identifier property.
*
*
* For example, to add a new item, do as follows:
*
* getIdentifier().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Identifier }
*
*
*/
public List getIdentifier() {
if (identifier == null) {
identifier = new ArrayList();
}
return this.identifier;
}
/**
* Gets the value of the title property.
*
* @return
* possible object is
* {@link org.hl7.fhir.String }
*
*/
public org.hl7.fhir.String getTitle() {
return title;
}
/**
* Sets the value of the title property.
*
* @param value
* allowed object is
* {@link org.hl7.fhir.String }
*
*/
public void setTitle(org.hl7.fhir.String value) {
this.title = value;
}
/**
* Gets the value of the status property.
*
* @return
* possible object is
* {@link ProtocolStatus }
*
*/
public ProtocolStatus getStatus() {
return status;
}
/**
* Sets the value of the status property.
*
* @param value
* allowed object is
* {@link ProtocolStatus }
*
*/
public void setStatus(ProtocolStatus value) {
this.status = value;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link ProtocolType }
*
*/
public ProtocolType getType() {
return type;
}
/**
* Sets the value of the type property.
*
* @param value
* allowed object is
* {@link ProtocolType }
*
*/
public void setType(ProtocolType value) {
this.type = value;
}
/**
* Gets the value of the subject property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getSubject() {
return subject;
}
/**
* Sets the value of the subject property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setSubject(Reference value) {
this.subject = value;
}
/**
* Gets the value of the group property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getGroup() {
return group;
}
/**
* Sets the value of the group property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setGroup(Reference value) {
this.group = value;
}
/**
* Gets the value of the purpose property.
*
* @return
* possible object is
* {@link org.hl7.fhir.String }
*
*/
public org.hl7.fhir.String getPurpose() {
return purpose;
}
/**
* Sets the value of the purpose property.
*
* @param value
* allowed object is
* {@link org.hl7.fhir.String }
*
*/
public void setPurpose(org.hl7.fhir.String value) {
this.purpose = value;
}
/**
* Gets the value of the author property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getAuthor() {
return author;
}
/**
* Sets the value of the author property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setAuthor(Reference value) {
this.author = value;
}
/**
* Gets the value of the step 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 step property.
*
*
* For example, to add a new item, do as follows:
*
* getStep().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link ProtocolStep }
*
*
*/
public List getStep() {
if (step == null) {
step = new ArrayList();
}
return this.step;
}
public Protocol withIdentifier(Identifier... values) {
if (values!= null) {
for (Identifier value: values) {
getIdentifier().add(value);
}
}
return this;
}
public Protocol withIdentifier(Collection values) {
if (values!= null) {
getIdentifier().addAll(values);
}
return this;
}
public Protocol withTitle(org.hl7.fhir.String value) {
setTitle(value);
return this;
}
public Protocol withStatus(ProtocolStatus value) {
setStatus(value);
return this;
}
public Protocol withType(ProtocolType value) {
setType(value);
return this;
}
public Protocol withSubject(Reference value) {
setSubject(value);
return this;
}
public Protocol withGroup(Reference value) {
setGroup(value);
return this;
}
public Protocol withPurpose(org.hl7.fhir.String value) {
setPurpose(value);
return this;
}
public Protocol withAuthor(Reference value) {
setAuthor(value);
return this;
}
public Protocol withStep(ProtocolStep... values) {
if (values!= null) {
for (ProtocolStep value: values) {
getStep().add(value);
}
}
return this;
}
public Protocol withStep(Collection values) {
if (values!= null) {
getStep().addAll(values);
}
return this;
}
@Override
public Protocol withText(Narrative value) {
setText(value);
return this;
}
@Override
public Protocol withContained(ResourceContainer... values) {
if (values!= null) {
for (ResourceContainer value: values) {
getContained().add(value);
}
}
return this;
}
@Override
public Protocol withContained(Collection values) {
if (values!= null) {
getContained().addAll(values);
}
return this;
}
@Override
public Protocol withExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtension().add(value);
}
}
return this;
}
@Override
public Protocol withExtension(Collection values) {
if (values!= null) {
getExtension().addAll(values);
}
return this;
}
@Override
public Protocol withModifierExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getModifierExtension().add(value);
}
}
return this;
}
@Override
public Protocol withModifierExtension(Collection values) {
if (values!= null) {
getModifierExtension().addAll(values);
}
return this;
}
@Override
public Protocol withId(Id value) {
setId(value);
return this;
}
@Override
public Protocol withMeta(Meta value) {
setMeta(value);
return this;
}
@Override
public Protocol withImplicitRules(Uri value) {
setImplicitRules(value);
return this;
}
@Override
public Protocol withLanguage(Code value) {
setLanguage(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 Protocol that = ((Protocol) object);
{
List lhsIdentifier;
lhsIdentifier = (((this.identifier!= null)&&(!this.identifier.isEmpty()))?this.getIdentifier():null);
List rhsIdentifier;
rhsIdentifier = (((that.identifier!= null)&&(!that.identifier.isEmpty()))?that.getIdentifier():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "identifier", lhsIdentifier), LocatorUtils.property(thatLocator, "identifier", rhsIdentifier), lhsIdentifier, rhsIdentifier, ((this.identifier!= null)&&(!this.identifier.isEmpty())), ((that.identifier!= null)&&(!that.identifier.isEmpty())))) {
return false;
}
}
{
org.hl7.fhir.String lhsTitle;
lhsTitle = this.getTitle();
org.hl7.fhir.String rhsTitle;
rhsTitle = that.getTitle();
if (!strategy.equals(LocatorUtils.property(thisLocator, "title", lhsTitle), LocatorUtils.property(thatLocator, "title", rhsTitle), lhsTitle, rhsTitle, (this.title!= null), (that.title!= null))) {
return false;
}
}
{
ProtocolStatus lhsStatus;
lhsStatus = this.getStatus();
ProtocolStatus rhsStatus;
rhsStatus = that.getStatus();
if (!strategy.equals(LocatorUtils.property(thisLocator, "status", lhsStatus), LocatorUtils.property(thatLocator, "status", rhsStatus), lhsStatus, rhsStatus, (this.status!= null), (that.status!= null))) {
return false;
}
}
{
ProtocolType lhsType;
lhsType = this.getType();
ProtocolType 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;
}
}
{
Reference lhsSubject;
lhsSubject = this.getSubject();
Reference rhsSubject;
rhsSubject = that.getSubject();
if (!strategy.equals(LocatorUtils.property(thisLocator, "subject", lhsSubject), LocatorUtils.property(thatLocator, "subject", rhsSubject), lhsSubject, rhsSubject, (this.subject!= null), (that.subject!= null))) {
return false;
}
}
{
Reference lhsGroup;
lhsGroup = this.getGroup();
Reference rhsGroup;
rhsGroup = that.getGroup();
if (!strategy.equals(LocatorUtils.property(thisLocator, "group", lhsGroup), LocatorUtils.property(thatLocator, "group", rhsGroup), lhsGroup, rhsGroup, (this.group!= null), (that.group!= null))) {
return false;
}
}
{
org.hl7.fhir.String lhsPurpose;
lhsPurpose = this.getPurpose();
org.hl7.fhir.String rhsPurpose;
rhsPurpose = that.getPurpose();
if (!strategy.equals(LocatorUtils.property(thisLocator, "purpose", lhsPurpose), LocatorUtils.property(thatLocator, "purpose", rhsPurpose), lhsPurpose, rhsPurpose, (this.purpose!= null), (that.purpose!= null))) {
return false;
}
}
{
Reference lhsAuthor;
lhsAuthor = this.getAuthor();
Reference rhsAuthor;
rhsAuthor = that.getAuthor();
if (!strategy.equals(LocatorUtils.property(thisLocator, "author", lhsAuthor), LocatorUtils.property(thatLocator, "author", rhsAuthor), lhsAuthor, rhsAuthor, (this.author!= null), (that.author!= null))) {
return false;
}
}
{
List lhsStep;
lhsStep = (((this.step!= null)&&(!this.step.isEmpty()))?this.getStep():null);
List rhsStep;
rhsStep = (((that.step!= null)&&(!that.step.isEmpty()))?that.getStep():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "step", lhsStep), LocatorUtils.property(thatLocator, "step", rhsStep), lhsStep, rhsStep, ((this.step!= null)&&(!this.step.isEmpty())), ((that.step!= null)&&(!that.step.isEmpty())))) {
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);
{
List theIdentifier;
theIdentifier = (((this.identifier!= null)&&(!this.identifier.isEmpty()))?this.getIdentifier():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "identifier", theIdentifier), currentHashCode, theIdentifier, ((this.identifier!= null)&&(!this.identifier.isEmpty())));
}
{
org.hl7.fhir.String theTitle;
theTitle = this.getTitle();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "title", theTitle), currentHashCode, theTitle, (this.title!= null));
}
{
ProtocolStatus theStatus;
theStatus = this.getStatus();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus, (this.status!= null));
}
{
ProtocolType theType;
theType = this.getType();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType, (this.type!= null));
}
{
Reference theSubject;
theSubject = this.getSubject();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "subject", theSubject), currentHashCode, theSubject, (this.subject!= null));
}
{
Reference theGroup;
theGroup = this.getGroup();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "group", theGroup), currentHashCode, theGroup, (this.group!= null));
}
{
org.hl7.fhir.String thePurpose;
thePurpose = this.getPurpose();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "purpose", thePurpose), currentHashCode, thePurpose, (this.purpose!= null));
}
{
Reference theAuthor;
theAuthor = this.getAuthor();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "author", theAuthor), currentHashCode, theAuthor, (this.author!= null));
}
{
List theStep;
theStep = (((this.step!= null)&&(!this.step.isEmpty()))?this.getStep():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "step", theStep), currentHashCode, theStep, ((this.step!= null)&&(!this.step.isEmpty())));
}
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);
{
List theIdentifier;
theIdentifier = (((this.identifier!= null)&&(!this.identifier.isEmpty()))?this.getIdentifier():null);
strategy.appendField(locator, this, "identifier", buffer, theIdentifier, ((this.identifier!= null)&&(!this.identifier.isEmpty())));
}
{
org.hl7.fhir.String theTitle;
theTitle = this.getTitle();
strategy.appendField(locator, this, "title", buffer, theTitle, (this.title!= null));
}
{
ProtocolStatus theStatus;
theStatus = this.getStatus();
strategy.appendField(locator, this, "status", buffer, theStatus, (this.status!= null));
}
{
ProtocolType theType;
theType = this.getType();
strategy.appendField(locator, this, "type", buffer, theType, (this.type!= null));
}
{
Reference theSubject;
theSubject = this.getSubject();
strategy.appendField(locator, this, "subject", buffer, theSubject, (this.subject!= null));
}
{
Reference theGroup;
theGroup = this.getGroup();
strategy.appendField(locator, this, "group", buffer, theGroup, (this.group!= null));
}
{
org.hl7.fhir.String thePurpose;
thePurpose = this.getPurpose();
strategy.appendField(locator, this, "purpose", buffer, thePurpose, (this.purpose!= null));
}
{
Reference theAuthor;
theAuthor = this.getAuthor();
strategy.appendField(locator, this, "author", buffer, theAuthor, (this.author!= null));
}
{
List theStep;
theStep = (((this.step!= null)&&(!this.step.isEmpty()))?this.getStep():null);
strategy.appendField(locator, this, "step", buffer, theStep, ((this.step!= null)&&(!this.step.isEmpty())));
}
return buffer;
}
}