org.hl7.cql_annotations.r1.Annotation Maven / Gradle / Ivy
Show all versions of elm Show documentation
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.4.0-b180830.0438
// See https://javaee.github.io/jaxb-v2/
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.03.28 at 04:17:15 PM MDT
//
package org.hl7.cql_annotations.r1;
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.XmlElement;
import javax.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;
/**
* Java class for Annotation complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="Annotation">
* <complexContent>
* <extension base="{urn:hl7-org:cql-annotations:r1}CqlToElmBase">
* <sequence>
* <element name="t" type="{urn:hl7-org:cql-annotations:r1}Tag" maxOccurs="unbounded" minOccurs="0"/>
* <element name="s" type="{urn:hl7-org:cql-annotations:r1}Narrative" minOccurs="0"/>
* <element name="locator" type="{urn:hl7-org:cql-annotations:r1}Locator" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Annotation", namespace = "urn:hl7-org:cql-annotations:r1", propOrder = {
"t",
"s",
"locator"
})
public class Annotation
extends CqlToElmBase
implements Equals2, HashCode2, ToString2
{
@XmlElement(namespace = "urn:hl7-org:cql-annotations:r1")
protected List t;
@XmlElement(namespace = "urn:hl7-org:cql-annotations:r1")
protected Narrative s;
@XmlElement(namespace = "urn:hl7-org:cql-annotations:r1")
protected Locator locator;
/**
* Gets the value of the t 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 t property.
*
*
* For example, to add a new item, do as follows:
*
* getT().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Tag }
*
*
*/
public List getT() {
if (t == null) {
t = new ArrayList();
}
return this.t;
}
/**
* Gets the value of the s property.
*
* @return
* possible object is
* {@link Narrative }
*
*/
public Narrative getS() {
return s;
}
/**
* Sets the value of the s property.
*
* @param value
* allowed object is
* {@link Narrative }
*
*/
public void setS(Narrative value) {
this.s = value;
}
/**
* Gets the value of the locator property.
*
* @return
* possible object is
* {@link Locator }
*
*/
public Locator getLocator() {
return locator;
}
/**
* Sets the value of the locator property.
*
* @param value
* allowed object is
* {@link Locator }
*
*/
public void setLocator(Locator value) {
this.locator = value;
}
public Annotation withT(Tag... values) {
if (values!= null) {
for (Tag value: values) {
getT().add(value);
}
}
return this;
}
public Annotation withT(Collection values) {
if (values!= null) {
getT().addAll(values);
}
return this;
}
public Annotation withS(Narrative value) {
setS(value);
return this;
}
public Annotation withLocator(Locator value) {
setLocator(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 Annotation that = ((Annotation) object);
{
List lhsT;
lhsT = (((this.t!= null)&&(!this.t.isEmpty()))?this.getT():null);
List rhsT;
rhsT = (((that.t!= null)&&(!that.t.isEmpty()))?that.getT():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "t", lhsT), LocatorUtils.property(thatLocator, "t", rhsT), lhsT, rhsT, ((this.t!= null)&&(!this.t.isEmpty())), ((that.t!= null)&&(!that.t.isEmpty())))) {
return false;
}
}
{
Narrative lhsS;
lhsS = this.getS();
Narrative rhsS;
rhsS = that.getS();
if (!strategy.equals(LocatorUtils.property(thisLocator, "s", lhsS), LocatorUtils.property(thatLocator, "s", rhsS), lhsS, rhsS, (this.s!= null), (that.s!= null))) {
return false;
}
}
{
Locator lhsLocator;
lhsLocator = this.getLocator();
Locator rhsLocator;
rhsLocator = that.getLocator();
if (!strategy.equals(LocatorUtils.property(thisLocator, "locator", lhsLocator), LocatorUtils.property(thatLocator, "locator", rhsLocator), lhsLocator, rhsLocator, (this.locator!= null), (that.locator!= 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 theT;
theT = (((this.t!= null)&&(!this.t.isEmpty()))?this.getT():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "t", theT), currentHashCode, theT, ((this.t!= null)&&(!this.t.isEmpty())));
}
{
Narrative theS;
theS = this.getS();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "s", theS), currentHashCode, theS, (this.s!= null));
}
{
Locator theLocator;
theLocator = this.getLocator();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "locator", theLocator), currentHashCode, theLocator, (this.locator!= null));
}
return currentHashCode;
}
@Override
public int hashCode() {
final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.getInstance();
return this.hashCode(null, strategy);
}
@Override
public 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 theT;
theT = (((this.t!= null)&&(!this.t.isEmpty()))?this.getT():null);
strategy.appendField(locator, this, "t", buffer, theT, ((this.t!= null)&&(!this.t.isEmpty())));
}
{
Narrative theS;
theS = this.getS();
strategy.appendField(locator, this, "s", buffer, theS, (this.s!= null));
}
{
Locator theLocator;
theLocator = this.getLocator();
strategy.appendField(locator, this, "locator", buffer, theLocator, (this.locator!= null));
}
return buffer;
}
}