
org.hl7.fhir.Timing Maven / Gradle / Ivy
Show all versions of quick Show documentation
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.01.12 at 11:04:27 AM MST
//
package org.hl7.fhir;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
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.ToString;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
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 Equals, HashCode, ToString
{
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 JAXB 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;
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
if (!(object instanceof Timing)) {
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)) {
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)) {
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)) {
return false;
}
}
return true;
}
public boolean equals(Object object) {
final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
return equals(null, null, object, strategy);
}
public int hashCode(ObjectLocator locator, HashCodeStrategy 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);
}
{
TimingRepeat theRepeat;
theRepeat = this.getRepeat();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "repeat", theRepeat), currentHashCode, theRepeat);
}
{
CodeableConcept theCode;
theCode = this.getCode();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "code", theCode), currentHashCode, theCode);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public java.lang.String toString() {
final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy 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);
}
{
TimingRepeat theRepeat;
theRepeat = this.getRepeat();
strategy.appendField(locator, this, "repeat", buffer, theRepeat);
}
{
CodeableConcept theCode;
theCode = this.getCode();
strategy.appendField(locator, this, "code", buffer, theCode);
}
return buffer;
}
}