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

org.openestate.is24.restapi.xml.common.DateRange Maven / Gradle / Ivy


package org.openestate.is24.restapi.xml.common;

import java.io.Serializable;
import java.util.Calendar;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
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;
import org.openestate.is24.restapi.xml.Adapter2;


/**
 * Datum von bis
 * 
 * 

Java class for DateRange complex type. * *

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

 * <complexType name="DateRange">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <all>
 *         <element name="dateFrom" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
 *         <element name="dateTo" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
 *       </all>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DateRange", propOrder = { }) public class DateRange implements Serializable, Cloneable, CopyTo2, Equals2, ToString2 { @XmlElement(type = String.class) @XmlJavaTypeAdapter(Adapter2 .class) @XmlSchemaType(name = "dateTime") protected Calendar dateFrom; @XmlElement(type = String.class) @XmlJavaTypeAdapter(Adapter2 .class) @XmlSchemaType(name = "dateTime") protected Calendar dateTo; /** * Gets the value of the dateFrom property. * * @return * possible object is * {@link String } * */ public Calendar getDateFrom() { return dateFrom; } /** * Sets the value of the dateFrom property. * * @param value * allowed object is * {@link String } * */ public void setDateFrom(Calendar value) { this.dateFrom = value; } /** * Gets the value of the dateTo property. * * @return * possible object is * {@link String } * */ public Calendar getDateTo() { return dateTo; } /** * Sets the value of the dateTo property. * * @param value * allowed object is * {@link String } * */ public void setDateTo(Calendar value) { this.dateTo = value; } public String toString() { final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE; 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) { { Calendar theDateFrom; theDateFrom = this.getDateFrom(); strategy.appendField(locator, this, "dateFrom", buffer, theDateFrom, (this.dateFrom!= null)); } { Calendar theDateTo; theDateTo = this.getDateTo(); strategy.appendField(locator, this, "dateTo", buffer, theDateTo, (this.dateTo!= null)); } return buffer; } public Object clone() { return copyTo(createNewInstance()); } public Object copyTo(Object target) { final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE; return copyTo(null, target, strategy); } public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof DateRange) { final DateRange copy = ((DateRange) draftCopy); { Boolean dateFromShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.dateFrom!= null)); if (dateFromShouldBeCopiedAndSet == Boolean.TRUE) { Calendar sourceDateFrom; sourceDateFrom = this.getDateFrom(); Calendar copyDateFrom = ((Calendar) strategy.copy(LocatorUtils.property(locator, "dateFrom", sourceDateFrom), sourceDateFrom, (this.dateFrom!= null))); copy.setDateFrom(copyDateFrom); } else { if (dateFromShouldBeCopiedAndSet == Boolean.FALSE) { copy.dateFrom = null; } } } { Boolean dateToShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.dateTo!= null)); if (dateToShouldBeCopiedAndSet == Boolean.TRUE) { Calendar sourceDateTo; sourceDateTo = this.getDateTo(); Calendar copyDateTo = ((Calendar) strategy.copy(LocatorUtils.property(locator, "dateTo", sourceDateTo), sourceDateTo, (this.dateTo!= null))); copy.setDateTo(copyDateTo); } else { if (dateToShouldBeCopiedAndSet == Boolean.FALSE) { copy.dateTo = null; } } } } return draftCopy; } public Object createNewInstance() { return new DateRange(); } 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; } final DateRange that = ((DateRange) object); { Calendar lhsDateFrom; lhsDateFrom = this.getDateFrom(); Calendar rhsDateFrom; rhsDateFrom = that.getDateFrom(); if (!strategy.equals(LocatorUtils.property(thisLocator, "dateFrom", lhsDateFrom), LocatorUtils.property(thatLocator, "dateFrom", rhsDateFrom), lhsDateFrom, rhsDateFrom, (this.dateFrom!= null), (that.dateFrom!= null))) { return false; } } { Calendar lhsDateTo; lhsDateTo = this.getDateTo(); Calendar rhsDateTo; rhsDateTo = that.getDateTo(); if (!strategy.equals(LocatorUtils.property(thisLocator, "dateTo", lhsDateTo), LocatorUtils.property(thatLocator, "dateTo", rhsDateTo), lhsDateTo, rhsDateTo, (this.dateTo!= null), (that.dateTo!= null))) { return false; } } return true; } public boolean equals(Object object) { final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy