org.hl7.fhir.Timing 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.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 Timing complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="Timing">
* <complexContent>
* <extension base="{http://hl7.org/fhir}Element">
* <sequence>
* <element name="event" type="{http://hl7.org/fhir}dateTime" maxOccurs="unbounded" minOccurs="0"/>
* <element name="repeat" type="{http://hl7.org/fhir}Timing.Repeat" minOccurs="0"/>
* <element name="code" type="{http://hl7.org/fhir}CodeableConcept" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Timing", propOrder = {
"event",
"repeat",
"code"
})
public class Timing
extends Element
implements Equals2, HashCode2, ToString2
{
protected List event;
protected TimingRepeat repeat;
protected CodeableConcept code;
/**
* Gets the value of the event 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 event property.
*
*
* For example, to add a new item, do as follows:
*
* getEvent().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link DateTime }
*
*
*/
public List getEvent() {
if (event == null) {
event = new ArrayList();
}
return this.event;
}
/**
* Gets the value of the repeat property.
*
* @return
* possible object is
* {@link TimingRepeat }
*
*/
public TimingRepeat getRepeat() {
return repeat;
}
/**
* Sets the value of the repeat property.
*
* @param value
* allowed object is
* {@link TimingRepeat }
*
*/
public void setRepeat(TimingRepeat value) {
this.repeat = value;
}
/**
* Gets the value of the code property.
*
* @return
* possible object is
* {@link CodeableConcept }
*
*/
public CodeableConcept getCode() {
return code;
}
/**
* Sets the value of the code property.
*
* @param value
* allowed object is
* {@link CodeableConcept }
*
*/
public void setCode(CodeableConcept value) {
this.code = value;
}
public Timing withEvent(DateTime... values) {
if (values!= null) {
for (DateTime value: values) {
getEvent().add(value);
}
}
return this;
}
public Timing withEvent(Collection values) {
if (values!= null) {
getEvent().addAll(values);
}
return this;
}
public Timing withRepeat(TimingRepeat value) {
setRepeat(value);
return this;
}
public Timing withCode(CodeableConcept value) {
setCode(value);
return this;
}
@Override
public Timing withExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtension().add(value);
}
}
return this;
}
@Override
public Timing withExtension(Collection values) {
if (values!= null) {
getExtension().addAll(values);
}
return this;
}
@Override
public Timing 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 Timing that = ((Timing) object);
{
List lhsEvent;
lhsEvent = (((this.event!= null)&&(!this.event.isEmpty()))?this.getEvent():null);
List rhsEvent;
rhsEvent = (((that.event!= null)&&(!that.event.isEmpty()))?that.getEvent():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "event", lhsEvent), LocatorUtils.property(thatLocator, "event", rhsEvent), lhsEvent, rhsEvent, ((this.event!= null)&&(!this.event.isEmpty())), ((that.event!= null)&&(!that.event.isEmpty())))) {
return false;
}
}
{
TimingRepeat lhsRepeat;
lhsRepeat = this.getRepeat();
TimingRepeat rhsRepeat;
rhsRepeat = that.getRepeat();
if (!strategy.equals(LocatorUtils.property(thisLocator, "repeat", lhsRepeat), LocatorUtils.property(thatLocator, "repeat", rhsRepeat), lhsRepeat, rhsRepeat, (this.repeat!= null), (that.repeat!= null))) {
return false;
}
}
{
CodeableConcept lhsCode;
lhsCode = this.getCode();
CodeableConcept rhsCode;
rhsCode = that.getCode();
if (!strategy.equals(LocatorUtils.property(thisLocator, "code", lhsCode), LocatorUtils.property(thatLocator, "code", rhsCode), lhsCode, rhsCode, (this.code!= null), (that.code!= 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);
{
List theEvent;
theEvent = (((this.event!= null)&&(!this.event.isEmpty()))?this.getEvent():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "event", theEvent), currentHashCode, theEvent, ((this.event!= null)&&(!this.event.isEmpty())));
}
{
TimingRepeat theRepeat;
theRepeat = this.getRepeat();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "repeat", theRepeat), currentHashCode, theRepeat, (this.repeat!= null));
}
{
CodeableConcept theCode;
theCode = this.getCode();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "code", theCode), currentHashCode, theCode, (this.code!= 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);
{
List theEvent;
theEvent = (((this.event!= null)&&(!this.event.isEmpty()))?this.getEvent():null);
strategy.appendField(locator, this, "event", buffer, theEvent, ((this.event!= null)&&(!this.event.isEmpty())));
}
{
TimingRepeat theRepeat;
theRepeat = this.getRepeat();
strategy.appendField(locator, this, "repeat", buffer, theRepeat, (this.repeat!= null));
}
{
CodeableConcept theCode;
theCode = this.getCode();
strategy.appendField(locator, this, "code", buffer, theCode, (this.code!= null));
}
return buffer;
}
}