org.cqframework.cql.elm.execution.Case Maven / Gradle / Ivy
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0
// See https://javaee.github.io/jaxb-v2/
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2020.03.24 at 04:05:23 PM UTC
//
package org.cqframework.cql.elm.execution;
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.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;
/**
* The Case operator allows for multiple conditional expressions to be chained together in a single expression, rather than having to nest multiple If operators. In addition, the comparand operand provides a variant on the case that allows a single value to be compared in each conditional.
*
* If a comparand is not provided, the type of each when element of the caseItems within the Case is expected to be boolean. If a comparand is provided, the type of each when element of the caseItems within the Case is expected to be of the same type as the comparand. An else element must always be provided.
*
* The static type of the then argument within the first caseItem determines the type of the result, and the then argument of each subsequent caseItem and the else argument must be of that same type.
*
* Java class for Case complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="Case">
* <complexContent>
* <extension base="{urn:hl7-org:elm:r1}Expression">
* <sequence>
* <element name="comparand" type="{urn:hl7-org:elm:r1}Expression" minOccurs="0"/>
* <element name="caseItem" type="{urn:hl7-org:elm:r1}CaseItem" maxOccurs="unbounded"/>
* <element name="else" type="{urn:hl7-org:elm:r1}Expression"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Case", namespace = "urn:hl7-org:elm:r1", propOrder = {
"comparand",
"caseItem",
"_else"
})
public class Case
extends Expression
implements Equals, HashCode, ToString
{
@XmlElement(namespace = "urn:hl7-org:elm:r1")
protected Expression comparand;
@XmlElement(namespace = "urn:hl7-org:elm:r1", required = true)
protected List caseItem;
@XmlElement(name = "else", namespace = "urn:hl7-org:elm:r1", required = true)
protected Expression _else;
/**
* Gets the value of the comparand property.
*
* @return
* possible object is
* {@link Expression }
*
*/
public Expression getComparand() {
return comparand;
}
/**
* Sets the value of the comparand property.
*
* @param value
* allowed object is
* {@link Expression }
*
*/
public void setComparand(Expression value) {
this.comparand = value;
}
/**
* Gets the value of the caseItem 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 caseItem property.
*
*
* For example, to add a new item, do as follows:
*
* getCaseItem().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link CaseItem }
*
*
*/
public List getCaseItem() {
if (caseItem == null) {
caseItem = new ArrayList();
}
return this.caseItem;
}
/**
* Gets the value of the else property.
*
* @return
* possible object is
* {@link Expression }
*
*/
public Expression getElse() {
return _else;
}
/**
* Sets the value of the else property.
*
* @param value
* allowed object is
* {@link Expression }
*
*/
public void setElse(Expression value) {
this._else = value;
}
public Case withComparand(Expression value) {
setComparand(value);
return this;
}
public Case withCaseItem(CaseItem... values) {
if (values!= null) {
for (CaseItem value: values) {
getCaseItem().add(value);
}
}
return this;
}
public Case withCaseItem(Collection values) {
if (values!= null) {
getCaseItem().addAll(values);
}
return this;
}
public Case withElse(Expression value) {
setElse(value);
return this;
}
@Override
public Case withAnnotation(Object... values) {
if (values!= null) {
for (Object value: values) {
getAnnotation().add(value);
}
}
return this;
}
@Override
public Case withAnnotation(Collection