WorldBankData.java

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2018.10.06 at 11:55:00 AM CEST 
//


package com.hack23.cia.model.external.worldbank.data.impl;

import java.io.Serializable;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.hack23.cia.model.common.api.ModelObject;
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;


/**
 * <p>Java class for WorldBankData complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="WorldBankData"&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence minOccurs="0"&gt;
 *         &lt;element name="indicator" form="qualified"&gt;
 *           &lt;complexType&gt;
 *             &lt;simpleContent&gt;
 *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;NCName"&gt;
 *                 &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
 *               &lt;/extension&gt;
 *             &lt;/simpleContent&gt;
 *           &lt;/complexType&gt;
 *         &lt;/element&gt;
 *         &lt;element name="country" form="qualified"&gt;
 *           &lt;complexType&gt;
 *             &lt;simpleContent&gt;
 *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;NCName"&gt;
 *                 &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
 *               &lt;/extension&gt;
 *             &lt;/simpleContent&gt;
 *           &lt;/complexType&gt;
 *         &lt;/element&gt;
 *         &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/&gt;
 *         &lt;element name="date" type="{http://www.w3.org/2001/XMLSchema}int" form="qualified"/&gt;
 *       &lt;/sequence&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "WorldBankData", propOrder = {
    "indicator",
    "country",
    "dataValue",
    "yearDate"
})
@Entity(name = "WorldBankData")
@Table(name = "WORLD_BANK_DATA")
@Inheritance(strategy = InheritanceType.JOINED)
public class WorldBankData
    implements Serializable, ModelObject, Equals, HashCode, ToString
{

    protected Indicator indicator;
    protected Country country;
    @XmlElement(name = "value")
    protected String dataValue;
    @XmlElement(name = "date")
    protected Integer yearDate;
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
     * Gets the value of the indicator property.
     * 
     * @return
     *     possible object is
     *     {@link Indicator }
     *     
     */
    @Embedded
    @AttributeOverrides({
        @AttributeOverride(name = "value", column = @Column(name = "INDICATOR_VALUE", length = 255)),
        @AttributeOverride(name = "id", column = @Column(name = "INDICATOR_ID", length = 255))
    })
    public Indicator getIndicator() {
        return indicator;
    }

    /**
     * Sets the value of the indicator property.
     * 
     * @param value
     *     allowed object is
     *     {@link Indicator }
     *     
     */
    public void setIndicator(Indicator value) {
        this.indicator = value;
    }

    /**
     * Gets the value of the country property.
     * 
     * @return
     *     possible object is
     *     {@link Country }
     *     
     */
    @Embedded
    @AttributeOverrides({
        @AttributeOverride(name = "value", column = @Column(name = "COUNTRY_VALUE", length = 255)),
        @AttributeOverride(name = "id", column = @Column(name = "COUNTRY_ID", length = 255))
    })
    public Country getCountry() {
        return country;
    }

    /**
     * Sets the value of the country property.
     * 
     * @param value
     *     allowed object is
     *     {@link Country }
     *     
     */
    public void setCountry(Country value) {
        this.country = value;
    }

    /**
     * Gets the value of the dataValue property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    @Basic
    @Column(name = "DATA_VALUE", length = 255)
    public String getDataValue() {
        return dataValue;
    }

    /**
     * Sets the value of the dataValue property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setDataValue(String value) {
        this.dataValue = value;
    }

    /**
     * Gets the value of the yearDate property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    @Basic
    @Column(name = "YEAR_DATE", precision = 10, scale = 0)
    public Integer getYearDate() {
        return yearDate;
    }

    /**
     * Sets the value of the yearDate property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setYearDate(Integer value) {
        this.yearDate = value;
    }

    public WorldBankData withIndicator(Indicator value) {
        setIndicator(value);
        return this;
    }

    public WorldBankData withCountry(Country value) {
        setCountry(value);
        return this;
    }

    public WorldBankData withDataValue(String value) {
        setDataValue(value);
        return this;
    }

    public WorldBankData withYearDate(Integer value) {
        setYearDate(value);
        return this;
    }

    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) {
        {
            Indicator theIndicator;
            theIndicator = this.getIndicator();
            strategy.appendField(locator, this, "indicator", buffer, theIndicator);
        }
        {
            Country theCountry;
            theCountry = this.getCountry();
            strategy.appendField(locator, this, "country", buffer, theCountry);
        }
        {
            String theDataValue;
            theDataValue = this.getDataValue();
            strategy.appendField(locator, this, "dataValue", buffer, theDataValue);
        }
        {
            Integer theYearDate;
            theYearDate = this.getYearDate();
            strategy.appendField(locator, this, "yearDate", buffer, theYearDate);
        }
        return buffer;
    }

    /**
     * Gets the value of the hjid property.
     * 
     * @return
     *     possible object is
     *     {@link Long }
     *     
     */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
     * Sets the value of the hjid property.
     * 
     * @param value
     *     allowed object is
     *     {@link Long }
     *     
     */
    public void setHjid(Long value) {
        this.hjid = value;
    }

    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 WorldBankData that = ((WorldBankData) object);
        {
            Indicator lhsIndicator;
            lhsIndicator = this.getIndicator();
            Indicator rhsIndicator;
            rhsIndicator = that.getIndicator();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "indicator", lhsIndicator), LocatorUtils.property(thatLocator, "indicator", rhsIndicator), lhsIndicator, rhsIndicator)) {
                return false;
            }
        }
        {
            Country lhsCountry;
            lhsCountry = this.getCountry();
            Country rhsCountry;
            rhsCountry = that.getCountry();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "country", lhsCountry), LocatorUtils.property(thatLocator, "country", rhsCountry), lhsCountry, rhsCountry)) {
                return false;
            }
        }
        {
            String lhsDataValue;
            lhsDataValue = this.getDataValue();
            String rhsDataValue;
            rhsDataValue = that.getDataValue();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "dataValue", lhsDataValue), LocatorUtils.property(thatLocator, "dataValue", rhsDataValue), lhsDataValue, rhsDataValue)) {
                return false;
            }
        }
        {
            Integer lhsYearDate;
            lhsYearDate = this.getYearDate();
            Integer rhsYearDate;
            rhsYearDate = that.getYearDate();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "yearDate", lhsYearDate), LocatorUtils.property(thatLocator, "yearDate", rhsYearDate), lhsYearDate, rhsYearDate)) {
                return false;
            }
        }
        return true;
    }

    public boolean equals(Object object) {
        final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
        return equals(null, null, object, strategy);
    }

    public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
        int currentHashCode = 1;
        {
            Indicator theIndicator;
            theIndicator = this.getIndicator();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "indicator", theIndicator), currentHashCode, theIndicator);
        }
        {
            Country theCountry;
            theCountry = this.getCountry();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "country", theCountry), currentHashCode, theCountry);
        }
        {
            String theDataValue;
            theDataValue = this.getDataValue();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "dataValue", theDataValue), currentHashCode, theDataValue);
        }
        {
            Integer theYearDate;
            theYearDate = this.getYearDate();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "yearDate", theYearDate), currentHashCode, theYearDate);
        }
        return currentHashCode;
    }

    public int hashCode() {
        final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
        return this.hashCode(null, strategy);
    }

}