All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cqframework.cql.elm.execution.Date Maven / Gradle / Ivy

The newest version!
//
// 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: 2022.01.10 at 12:41:52 PM MST 
//


package org.cqframework.cql.elm.execution;

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.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 Date operator constructs a date value from the given components.
 * 
 * At least one component must be specified, and no component may be specified at a precision below an unspecified precision. For example, month may be null, but if it is, day must be null as well.
 * 
 * 

Java class for Date complex type. * *

The following schema fragment specifies the expected content contained within this class. * *

 * <complexType name="Date">
 *   <complexContent>
 *     <extension base="{urn:hl7-org:elm:r1}OperatorExpression">
 *       <sequence>
 *         <element name="year" type="{urn:hl7-org:elm:r1}Expression"/>
 *         <element name="month" type="{urn:hl7-org:elm:r1}Expression" minOccurs="0"/>
 *         <element name="day" type="{urn:hl7-org:elm:r1}Expression" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Date", namespace = "urn:hl7-org:elm:r1", propOrder = { "year", "month", "day" }) @SuppressWarnings({ "all" }) public class Date extends OperatorExpression implements Equals2, HashCode2, ToString2 { @XmlElement(namespace = "urn:hl7-org:elm:r1", required = true) protected Expression year; @XmlElement(namespace = "urn:hl7-org:elm:r1") protected Expression month; @XmlElement(namespace = "urn:hl7-org:elm:r1") protected Expression day; /** * Gets the value of the year property. * * @return * possible object is * {@link Expression } * */ public Expression getYear() { return year; } /** * Sets the value of the year property. * * @param value * allowed object is * {@link Expression } * */ public void setYear(Expression value) { this.year = value; } /** * Gets the value of the month property. * * @return * possible object is * {@link Expression } * */ public Expression getMonth() { return month; } /** * Sets the value of the month property. * * @param value * allowed object is * {@link Expression } * */ public void setMonth(Expression value) { this.month = value; } /** * Gets the value of the day property. * * @return * possible object is * {@link Expression } * */ public Expression getDay() { return day; } /** * Sets the value of the day property. * * @param value * allowed object is * {@link Expression } * */ public void setDay(Expression value) { this.day = value; } public Date withYear(Expression value) { setYear(value); return this; } public Date withMonth(Expression value) { setMonth(value); return this; } public Date withDay(Expression value) { setDay(value); return this; } @Override public Date withSignature(TypeSpecifier... values) { if (values!= null) { for (TypeSpecifier value: values) { getSignature().add(value); } } return this; } @Override public Date withSignature(Collection values) { if (values!= null) { getSignature().addAll(values); } return this; } @Override public Date withAnnotation(Object... values) { if (values!= null) { for (Object value: values) { getAnnotation().add(value); } } return this; } @Override public Date withAnnotation(Collection values) { if (values!= null) { getAnnotation().addAll(values); } return this; } @Override public Date withResultTypeSpecifier(TypeSpecifier value) { setResultTypeSpecifier(value); return this; } @Override public Date withLocalId(String value) { setLocalId(value); return this; } @Override public Date withLocator(String value) { setLocator(value); return this; } @Override public Date withResultTypeName(QName value) { setResultTypeName(value); return this; } 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 Date that = ((Date) object); { Expression lhsYear; lhsYear = this.getYear(); Expression rhsYear; rhsYear = that.getYear(); if (!strategy.equals(LocatorUtils.property(thisLocator, "year", lhsYear), LocatorUtils.property(thatLocator, "year", rhsYear), lhsYear, rhsYear, (this.year!= null), (that.year!= null))) { return false; } } { Expression lhsMonth; lhsMonth = this.getMonth(); Expression rhsMonth; rhsMonth = that.getMonth(); if (!strategy.equals(LocatorUtils.property(thisLocator, "month", lhsMonth), LocatorUtils.property(thatLocator, "month", rhsMonth), lhsMonth, rhsMonth, (this.month!= null), (that.month!= null))) { return false; } } { Expression lhsDay; lhsDay = this.getDay(); Expression rhsDay; rhsDay = that.getDay(); if (!strategy.equals(LocatorUtils.property(thisLocator, "day", lhsDay), LocatorUtils.property(thatLocator, "day", rhsDay), lhsDay, rhsDay, (this.day!= null), (that.day!= null))) { return false; } } return true; } public boolean equals(Object object) { final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE2; return equals(null, null, object, strategy); } public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = super.hashCode(locator, strategy); { Expression theYear; theYear = this.getYear(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "year", theYear), currentHashCode, theYear, (this.year!= null)); } { Expression theMonth; theMonth = this.getMonth(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "month", theMonth), currentHashCode, theMonth, (this.month!= null)); } { Expression theDay; theDay = this.getDay(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "day", theDay), currentHashCode, theDay, (this.day!= null)); } return currentHashCode; } public int hashCode() { final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.INSTANCE2; return this.hashCode(null, strategy); } public String toString() { final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE2; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } 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; } public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { super.appendFields(locator, buffer, strategy); { Expression theYear; theYear = this.getYear(); strategy.appendField(locator, this, "year", buffer, theYear, (this.year!= null)); } { Expression theMonth; theMonth = this.getMonth(); strategy.appendField(locator, this, "month", buffer, theMonth, (this.month!= null)); } { Expression theDay; theDay = this.getDay(); strategy.appendField(locator, this, "day", buffer, theDay, (this.day!= null)); } return buffer; } }