org.hl7.elm.r1.Query 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 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 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 Query operator represents a clause-based query. The result of the query is determined by the type of sources included, as well as the clauses used in the query.
*
* Java class for Query complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="Query">
* <complexContent>
* <extension base="{urn:hl7-org:elm:r1}Expression">
* <sequence>
* <element name="source" type="{urn:hl7-org:elm:r1}AliasedQuerySource" maxOccurs="unbounded"/>
* <element name="let" type="{urn:hl7-org:elm:r1}LetClause" maxOccurs="unbounded" minOccurs="0"/>
* <element name="relationship" type="{urn:hl7-org:elm:r1}RelationshipClause" maxOccurs="unbounded" minOccurs="0"/>
* <element name="where" type="{urn:hl7-org:elm:r1}Expression" minOccurs="0"/>
* <element name="return" type="{urn:hl7-org:elm:r1}ReturnClause" minOccurs="0"/>
* <element name="aggregate" type="{urn:hl7-org:elm:r1}AggregateClause" minOccurs="0"/>
* <element name="sort" type="{urn:hl7-org:elm:r1}SortClause" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Query", namespace = "urn:hl7-org:elm:r1", propOrder = {
"source",
"let",
"relationship",
"where",
"_return",
"aggregate",
"sort"
})
public class Query
extends Expression
implements Equals2, HashCode2, ToString2
{
@XmlElement(namespace = "urn:hl7-org:elm:r1", required = true)
protected List source;
@XmlElement(namespace = "urn:hl7-org:elm:r1")
protected List let;
@XmlElement(namespace = "urn:hl7-org:elm:r1")
protected List relationship;
@XmlElement(namespace = "urn:hl7-org:elm:r1")
protected Expression where;
@XmlElement(name = "return", namespace = "urn:hl7-org:elm:r1")
protected ReturnClause _return;
@XmlElement(namespace = "urn:hl7-org:elm:r1")
protected AggregateClause aggregate;
@XmlElement(namespace = "urn:hl7-org:elm:r1")
protected SortClause sort;
/**
* Gets the value of the source 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 source property.
*
*
* For example, to add a new item, do as follows:
*
* getSource().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link AliasedQuerySource }
*
*
*/
public List getSource() {
if (source == null) {
source = new ArrayList();
}
return this.source;
}
/**
* Gets the value of the let 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 let property.
*
*
* For example, to add a new item, do as follows:
*
* getLet().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link LetClause }
*
*
*/
public List getLet() {
if (let == null) {
let = new ArrayList();
}
return this.let;
}
/**
* Gets the value of the relationship 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 relationship property.
*
*
* For example, to add a new item, do as follows:
*
* getRelationship().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link RelationshipClause }
*
*
*/
public List getRelationship() {
if (relationship == null) {
relationship = new ArrayList();
}
return this.relationship;
}
/**
* Gets the value of the where property.
*
* @return
* possible object is
* {@link Expression }
*
*/
public Expression getWhere() {
return where;
}
/**
* Sets the value of the where property.
*
* @param value
* allowed object is
* {@link Expression }
*
*/
public void setWhere(Expression value) {
this.where = value;
}
/**
* Gets the value of the return property.
*
* @return
* possible object is
* {@link ReturnClause }
*
*/
public ReturnClause getReturn() {
return _return;
}
/**
* Sets the value of the return property.
*
* @param value
* allowed object is
* {@link ReturnClause }
*
*/
public void setReturn(ReturnClause value) {
this._return = value;
}
/**
* Gets the value of the aggregate property.
*
* @return
* possible object is
* {@link AggregateClause }
*
*/
public AggregateClause getAggregate() {
return aggregate;
}
/**
* Sets the value of the aggregate property.
*
* @param value
* allowed object is
* {@link AggregateClause }
*
*/
public void setAggregate(AggregateClause value) {
this.aggregate = value;
}
/**
* Gets the value of the sort property.
*
* @return
* possible object is
* {@link SortClause }
*
*/
public SortClause getSort() {
return sort;
}
/**
* Sets the value of the sort property.
*
* @param value
* allowed object is
* {@link SortClause }
*
*/
public void setSort(SortClause value) {
this.sort = value;
}
public Query withSource(AliasedQuerySource... values) {
if (values!= null) {
for (AliasedQuerySource value: values) {
getSource().add(value);
}
}
return this;
}
public Query withSource(Collection values) {
if (values!= null) {
getSource().addAll(values);
}
return this;
}
public Query withLet(LetClause... values) {
if (values!= null) {
for (LetClause value: values) {
getLet().add(value);
}
}
return this;
}
public Query withLet(Collection values) {
if (values!= null) {
getLet().addAll(values);
}
return this;
}
public Query withRelationship(RelationshipClause... values) {
if (values!= null) {
for (RelationshipClause value: values) {
getRelationship().add(value);
}
}
return this;
}
public Query withRelationship(Collection values) {
if (values!= null) {
getRelationship().addAll(values);
}
return this;
}
public Query withWhere(Expression value) {
setWhere(value);
return this;
}
public Query withReturn(ReturnClause value) {
setReturn(value);
return this;
}
public Query withAggregate(AggregateClause value) {
setAggregate(value);
return this;
}
public Query withSort(SortClause value) {
setSort(value);
return this;
}
@Override
public Query withAnnotation(CqlToElmBase... values) {
if (values!= null) {
for (CqlToElmBase value: values) {
getAnnotation().add(value);
}
}
return this;
}
@Override
public Query withAnnotation(Collection values) {
if (values!= null) {
getAnnotation().addAll(values);
}
return this;
}
@Override
public Query withResultTypeSpecifier(TypeSpecifier value) {
setResultTypeSpecifier(value);
return this;
}
@Override
public Query withLocalId(String value) {
setLocalId(value);
return this;
}
@Override
public Query withLocator(String value) {
setLocator(value);
return this;
}
@Override
public Query 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 Query that = ((Query) object);
{
List lhsSource;
lhsSource = (((this.source!= null)&&(!this.source.isEmpty()))?this.getSource():null);
List rhsSource;
rhsSource = (((that.source!= null)&&(!that.source.isEmpty()))?that.getSource():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "source", lhsSource), LocatorUtils.property(thatLocator, "source", rhsSource), lhsSource, rhsSource, ((this.source!= null)&&(!this.source.isEmpty())), ((that.source!= null)&&(!that.source.isEmpty())))) {
return false;
}
}
{
List lhsLet;
lhsLet = (((this.let!= null)&&(!this.let.isEmpty()))?this.getLet():null);
List rhsLet;
rhsLet = (((that.let!= null)&&(!that.let.isEmpty()))?that.getLet():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "let", lhsLet), LocatorUtils.property(thatLocator, "let", rhsLet), lhsLet, rhsLet, ((this.let!= null)&&(!this.let.isEmpty())), ((that.let!= null)&&(!that.let.isEmpty())))) {
return false;
}
}
{
List lhsRelationship;
lhsRelationship = (((this.relationship!= null)&&(!this.relationship.isEmpty()))?this.getRelationship():null);
List rhsRelationship;
rhsRelationship = (((that.relationship!= null)&&(!that.relationship.isEmpty()))?that.getRelationship():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "relationship", lhsRelationship), LocatorUtils.property(thatLocator, "relationship", rhsRelationship), lhsRelationship, rhsRelationship, ((this.relationship!= null)&&(!this.relationship.isEmpty())), ((that.relationship!= null)&&(!that.relationship.isEmpty())))) {
return false;
}
}
{
Expression lhsWhere;
lhsWhere = this.getWhere();
Expression rhsWhere;
rhsWhere = that.getWhere();
if (!strategy.equals(LocatorUtils.property(thisLocator, "where", lhsWhere), LocatorUtils.property(thatLocator, "where", rhsWhere), lhsWhere, rhsWhere, (this.where!= null), (that.where!= null))) {
return false;
}
}
{
ReturnClause lhsReturn;
lhsReturn = this.getReturn();
ReturnClause rhsReturn;
rhsReturn = that.getReturn();
if (!strategy.equals(LocatorUtils.property(thisLocator, "_return", lhsReturn), LocatorUtils.property(thatLocator, "_return", rhsReturn), lhsReturn, rhsReturn, (this._return!= null), (that._return!= null))) {
return false;
}
}
{
AggregateClause lhsAggregate;
lhsAggregate = this.getAggregate();
AggregateClause rhsAggregate;
rhsAggregate = that.getAggregate();
if (!strategy.equals(LocatorUtils.property(thisLocator, "aggregate", lhsAggregate), LocatorUtils.property(thatLocator, "aggregate", rhsAggregate), lhsAggregate, rhsAggregate, (this.aggregate!= null), (that.aggregate!= null))) {
return false;
}
}
{
SortClause lhsSort;
lhsSort = this.getSort();
SortClause rhsSort;
rhsSort = that.getSort();
if (!strategy.equals(LocatorUtils.property(thisLocator, "sort", lhsSort), LocatorUtils.property(thatLocator, "sort", rhsSort), lhsSort, rhsSort, (this.sort!= null), (that.sort!= 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 theSource;
theSource = (((this.source!= null)&&(!this.source.isEmpty()))?this.getSource():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "source", theSource), currentHashCode, theSource, ((this.source!= null)&&(!this.source.isEmpty())));
}
{
List theLet;
theLet = (((this.let!= null)&&(!this.let.isEmpty()))?this.getLet():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "let", theLet), currentHashCode, theLet, ((this.let!= null)&&(!this.let.isEmpty())));
}
{
List theRelationship;
theRelationship = (((this.relationship!= null)&&(!this.relationship.isEmpty()))?this.getRelationship():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "relationship", theRelationship), currentHashCode, theRelationship, ((this.relationship!= null)&&(!this.relationship.isEmpty())));
}
{
Expression theWhere;
theWhere = this.getWhere();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "where", theWhere), currentHashCode, theWhere, (this.where!= null));
}
{
ReturnClause theReturn;
theReturn = this.getReturn();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "_return", theReturn), currentHashCode, theReturn, (this._return!= null));
}
{
AggregateClause theAggregate;
theAggregate = this.getAggregate();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "aggregate", theAggregate), currentHashCode, theAggregate, (this.aggregate!= null));
}
{
SortClause theSort;
theSort = this.getSort();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sort", theSort), currentHashCode, theSort, (this.sort!= 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 theSource;
theSource = (((this.source!= null)&&(!this.source.isEmpty()))?this.getSource():null);
strategy.appendField(locator, this, "source", buffer, theSource, ((this.source!= null)&&(!this.source.isEmpty())));
}
{
List theLet;
theLet = (((this.let!= null)&&(!this.let.isEmpty()))?this.getLet():null);
strategy.appendField(locator, this, "let", buffer, theLet, ((this.let!= null)&&(!this.let.isEmpty())));
}
{
List theRelationship;
theRelationship = (((this.relationship!= null)&&(!this.relationship.isEmpty()))?this.getRelationship():null);
strategy.appendField(locator, this, "relationship", buffer, theRelationship, ((this.relationship!= null)&&(!this.relationship.isEmpty())));
}
{
Expression theWhere;
theWhere = this.getWhere();
strategy.appendField(locator, this, "where", buffer, theWhere, (this.where!= null));
}
{
ReturnClause theReturn;
theReturn = this.getReturn();
strategy.appendField(locator, this, "_return", buffer, theReturn, (this._return!= null));
}
{
AggregateClause theAggregate;
theAggregate = this.getAggregate();
strategy.appendField(locator, this, "aggregate", buffer, theAggregate, (this.aggregate!= null));
}
{
SortClause theSort;
theSort = this.getSort();
strategy.appendField(locator, this, "sort", buffer, theSort, (this.sort!= null));
}
return buffer;
}
}