
org.openestate.io.trovit.xml.Price Maven / Gradle / Ivy
package org.openestate.io.trovit.xml;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy;
import org.jvnet.jaxb2_commons.lang.CopyTo;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
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.ToString;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
import org.openestate.io.trovit.xml.types.PriceInterval;
/**
* Java class for anonymous complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType>
* <simpleContent>
* <extension base="<>typePriceString">
* <attribute name="period" type="{}typePrice" />
* </extension>
* </simpleContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
@XmlRootElement(name = "price")
public class Price
implements Cloneable, CopyTo, Equals, ToString
{
@XmlValue
@XmlJavaTypeAdapter(Adapter4 .class)
protected BigDecimal value;
@XmlAttribute(name = "period")
@XmlJavaTypeAdapter(Adapter5 .class)
protected PriceInterval period;
/**
* Pattern for prices
*
* @return
* possible object is
* {@link String }
*
*/
public BigDecimal getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(BigDecimal value) {
this.value = value;
}
/**
* Gets the value of the period property.
*
* @return
* possible object is
* {@link String }
*
*/
public PriceInterval getPeriod() {
return period;
}
/**
* Sets the value of the period property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPeriod(PriceInterval value) {
this.period = value;
}
public String toString() {
final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
{
BigDecimal theValue;
theValue = this.getValue();
strategy.appendField(locator, this, "value", buffer, theValue);
}
{
PriceInterval thePeriod;
thePeriod = this.getPeriod();
strategy.appendField(locator, this, "period", buffer, thePeriod);
}
return buffer;
}
public Object clone() {
return copyTo(createNewInstance());
}
public Object copyTo(Object target) {
final CopyStrategy strategy = JAXBCopyStrategy.INSTANCE;
return copyTo(null, target, strategy);
}
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) {
final Object draftCopy = ((target == null)?createNewInstance():target);
if (draftCopy instanceof Price) {
final Price copy = ((Price) draftCopy);
if (this.value!= null) {
BigDecimal sourceValue;
sourceValue = this.getValue();
BigDecimal copyValue = ((BigDecimal) strategy.copy(LocatorUtils.property(locator, "value", sourceValue), sourceValue));
copy.setValue(copyValue);
} else {
copy.value = null;
}
if (this.period!= null) {
PriceInterval sourcePeriod;
sourcePeriod = this.getPeriod();
PriceInterval copyPeriod = ((PriceInterval) strategy.copy(LocatorUtils.property(locator, "period", sourcePeriod), sourcePeriod));
copy.setPeriod(copyPeriod);
} else {
copy.period = null;
}
}
return draftCopy;
}
public Object createNewInstance() {
return new Price();
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final Price that = ((Price) object);
{
BigDecimal lhsValue;
lhsValue = this.getValue();
BigDecimal rhsValue;
rhsValue = that.getValue();
if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) {
return false;
}
}
{
PriceInterval lhsPeriod;
lhsPeriod = this.getPeriod();
PriceInterval rhsPeriod;
rhsPeriod = that.getPeriod();
if (!strategy.equals(LocatorUtils.property(thisLocator, "period", lhsPeriod), LocatorUtils.property(thatLocator, "period", rhsPeriod), lhsPeriod, rhsPeriod)) {
return false;
}
}
return true;
}
public boolean equals(Object object) {
final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
return equals(null, null, object, strategy);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy