org.hl7.elm.r1.List 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.08.24 at 01:22:35 PM MDT
//
package org.hl7.elm.r1;
import java.util.ArrayList;
import java.util.Collection;
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 javax.xml.namespace.QName;
import org.hl7.cql_annotations.r1.CqlToElmBase;
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;
/**
* The List selector returns a value of type List, whose elements are the result of evaluating the arguments to the List selector, in order.
*
* If a typeSpecifier element is provided, the list is of that type. Otherwise, the static type of the first argument determines the type of the resulting list, and each subsequent argument must be of that same type.
*
* If any argument is null, the resulting list will have null for that element.
*
* Java class for List complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="List">
* <complexContent>
* <extension base="{urn:hl7-org:elm:r1}Expression">
* <sequence>
* <element name="typeSpecifier" type="{urn:hl7-org:elm:r1}TypeSpecifier" minOccurs="0"/>
* <element name="element" type="{urn:hl7-org:elm:r1}Expression" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "List", namespace = "urn:hl7-org:elm:r1", propOrder = {
"typeSpecifier",
"element"
})
public class List
extends Expression
implements Equals2, HashCode2, ToString2
{
@XmlElement(namespace = "urn:hl7-org:elm:r1")
protected TypeSpecifier typeSpecifier;
@XmlElement(namespace = "urn:hl7-org:elm:r1")
protected java.util.List element;
/**
* Gets the value of the typeSpecifier property.
*
* @return
* possible object is
* {@link TypeSpecifier }
*
*/
public TypeSpecifier getTypeSpecifier() {
return typeSpecifier;
}
/**
* Sets the value of the typeSpecifier property.
*
* @param value
* allowed object is
* {@link TypeSpecifier }
*
*/
public void setTypeSpecifier(TypeSpecifier value) {
this.typeSpecifier = value;
}
/**
* Gets the value of the element 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 element property.
*
*
* For example, to add a new item, do as follows:
*
* getElement().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Expression }
*
*
*/
public java.util.List getElement() {
if (element == null) {
element = new ArrayList();
}
return this.element;
}
public List withTypeSpecifier(TypeSpecifier value) {
setTypeSpecifier(value);
return this;
}
public List withElement(Expression... values) {
if (values!= null) {
for (Expression value: values) {
getElement().add(value);
}
}
return this;
}
public List withElement(Collection values) {
if (values!= null) {
getElement().addAll(values);
}
return this;
}
@Override
public List withAnnotation(CqlToElmBase... values) {
if (values!= null) {
for (CqlToElmBase value: values) {
getAnnotation().add(value);
}
}
return this;
}
@Override
public List withAnnotation(Collection values) {
if (values!= null) {
getAnnotation().addAll(values);
}
return this;
}
@Override
public List withResultTypeSpecifier(TypeSpecifier value) {
setResultTypeSpecifier(value);
return this;
}
@Override
public List withLocalId(String value) {
setLocalId(value);
return this;
}
@Override
public List withLocator(String value) {
setLocator(value);
return this;
}
@Override
public List withResultTypeName(QName value) {
setResultTypeName(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 List that = ((List) object);
{
TypeSpecifier lhsTypeSpecifier;
lhsTypeSpecifier = this.getTypeSpecifier();
TypeSpecifier rhsTypeSpecifier;
rhsTypeSpecifier = that.getTypeSpecifier();
if (!strategy.equals(LocatorUtils.property(thisLocator, "typeSpecifier", lhsTypeSpecifier), LocatorUtils.property(thatLocator, "typeSpecifier", rhsTypeSpecifier), lhsTypeSpecifier, rhsTypeSpecifier, (this.typeSpecifier!= null), (that.typeSpecifier!= null))) {
return false;
}
}
{
java.util.List lhsElement;
lhsElement = (((this.element!= null)&&(!this.element.isEmpty()))?this.getElement():null);
java.util.List rhsElement;
rhsElement = (((that.element!= null)&&(!that.element.isEmpty()))?that.getElement():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "element", lhsElement), LocatorUtils.property(thatLocator, "element", rhsElement), lhsElement, rhsElement, ((this.element!= null)&&(!this.element.isEmpty())), ((that.element!= null)&&(!that.element.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);
{
TypeSpecifier theTypeSpecifier;
theTypeSpecifier = this.getTypeSpecifier();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "typeSpecifier", theTypeSpecifier), currentHashCode, theTypeSpecifier, (this.typeSpecifier!= null));
}
{
java.util.List theElement;
theElement = (((this.element!= null)&&(!this.element.isEmpty()))?this.getElement():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "element", theElement), currentHashCode, theElement, ((this.element!= null)&&(!this.element.isEmpty())));
}
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);
{
TypeSpecifier theTypeSpecifier;
theTypeSpecifier = this.getTypeSpecifier();
strategy.appendField(locator, this, "typeSpecifier", buffer, theTypeSpecifier, (this.typeSpecifier!= null));
}
{
java.util.List theElement;
theElement = (((this.element!= null)&&(!this.element.isEmpty()))?this.getElement():null);
strategy.appendField(locator, this, "element", buffer, theElement, ((this.element!= null)&&(!this.element.isEmpty())));
}
return buffer;
}
}