CountryElement.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:54:38 AM CEST 
//


package com.hack23.cia.model.external.worldbank.countries.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.XmlRootElement;
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 anonymous complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence&gt;
 *         &lt;element name="iso2Code" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/&gt;
 *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/&gt;
 *         &lt;element name="region" form="qualified"&gt;
 *           &lt;complexType&gt;
 *             &lt;simpleContent&gt;
 *               &lt;extension base="&lt;http://countries.worldbank.external.model.cia.hack23.com/impl&gt;RegionCategory"&gt;
 *                 &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}token" /&gt;
 *               &lt;/extension&gt;
 *             &lt;/simpleContent&gt;
 *           &lt;/complexType&gt;
 *         &lt;/element&gt;
 *         &lt;element name="adminregion" form="qualified"&gt;
 *           &lt;complexType&gt;
 *             &lt;simpleContent&gt;
 *               &lt;extension base="&lt;http://countries.worldbank.external.model.cia.hack23.com/impl&gt;AdminRegionCategory"&gt;
 *                 &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}token" /&gt;
 *               &lt;/extension&gt;
 *             &lt;/simpleContent&gt;
 *           &lt;/complexType&gt;
 *         &lt;/element&gt;
 *         &lt;element name="incomeLevel" form="qualified"&gt;
 *           &lt;complexType&gt;
 *             &lt;simpleContent&gt;
 *               &lt;extension base="&lt;http://countries.worldbank.external.model.cia.hack23.com/impl&gt;IncomeLevelCategory"&gt;
 *                 &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}token" /&gt;
 *               &lt;/extension&gt;
 *             &lt;/simpleContent&gt;
 *           &lt;/complexType&gt;
 *         &lt;/element&gt;
 *         &lt;element name="lendingType" form="qualified"&gt;
 *           &lt;complexType&gt;
 *             &lt;simpleContent&gt;
 *               &lt;extension base="&lt;http://countries.worldbank.external.model.cia.hack23.com/impl&gt;LendingTypeCategory"&gt;
 *                 &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}token" /&gt;
 *               &lt;/extension&gt;
 *             &lt;/simpleContent&gt;
 *           &lt;/complexType&gt;
 *         &lt;/element&gt;
 *         &lt;element name="capitalCity" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/&gt;
 *         &lt;element name="longitude" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/&gt;
 *         &lt;element name="latitude" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/&gt;
 *       &lt;/sequence&gt;
 *       &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "iso2Code",
    "countryName",
    "region",
    "adminregion",
    "incomeLevel",
    "lendingType",
    "capitalCity",
    "longitude",
    "latitude"
})
@XmlRootElement(name = "country")
@Entity(name = "CountryElement")
@Table(name = "COUNTRY_ELEMENT")
@Inheritance(strategy = InheritanceType.JOINED)
public class CountryElement
    implements Serializable, ModelObject, Equals, HashCode, ToString
{

    @XmlElement(required = true)
    protected String iso2Code;
    @XmlElement(name = "name", required = true)
    protected String countryName;
    @XmlElement(required = true)
    protected Region region;
    @XmlElement(required = true)
    protected Adminregion adminregion;
    @XmlElement(required = true)
    protected IncomeLevel incomeLevel;
    @XmlElement(required = true)
    protected LendingType lendingType;
    @XmlElement(required = true)
    protected String capitalCity;
    @XmlElement(required = true)
    protected String longitude;
    @XmlElement(required = true)
    protected String latitude;
    @XmlAttribute(name = "id")
    protected String id;
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

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

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

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

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

    /**
     * Gets the value of the region property.
     * 
     * @return
     *     possible object is
     *     {@link Region }
     *     
     */
    @Embedded
    @AttributeOverrides({
        @AttributeOverride(name = "value", column = @Column(name = "REGION_VALUE", length = 255)),
        @AttributeOverride(name = "id", column = @Column(name = "REGION_ID", length = 255))
    })
    public Region getRegion() {
        return region;
    }

    /**
     * Sets the value of the region property.
     * 
     * @param value
     *     allowed object is
     *     {@link Region }
     *     
     */
    public void setRegion(Region value) {
        this.region = value;
    }

    /**
     * Gets the value of the adminregion property.
     * 
     * @return
     *     possible object is
     *     {@link Adminregion }
     *     
     */
    @Embedded
    @AttributeOverrides({
        @AttributeOverride(name = "value", column = @Column(name = "ADMINREGION_VALUE", length = 255)),
        @AttributeOverride(name = "id", column = @Column(name = "ADMINREGION_ID", length = 255))
    })
    public Adminregion getAdminregion() {
        return adminregion;
    }

    /**
     * Sets the value of the adminregion property.
     * 
     * @param value
     *     allowed object is
     *     {@link Adminregion }
     *     
     */
    public void setAdminregion(Adminregion value) {
        this.adminregion = value;
    }

    /**
     * Gets the value of the incomeLevel property.
     * 
     * @return
     *     possible object is
     *     {@link IncomeLevel }
     *     
     */
    @Embedded
    @AttributeOverrides({
        @AttributeOverride(name = "value", column = @Column(name = "INCOME_LEVEL_VALUE", length = 255)),
        @AttributeOverride(name = "id", column = @Column(name = "INCOME_LEVEL_ID", length = 255))
    })
    public IncomeLevel getIncomeLevel() {
        return incomeLevel;
    }

    /**
     * Sets the value of the incomeLevel property.
     * 
     * @param value
     *     allowed object is
     *     {@link IncomeLevel }
     *     
     */
    public void setIncomeLevel(IncomeLevel value) {
        this.incomeLevel = value;
    }

    /**
     * Gets the value of the lendingType property.
     * 
     * @return
     *     possible object is
     *     {@link LendingType }
     *     
     */
    @Embedded
    @AttributeOverrides({
        @AttributeOverride(name = "value", column = @Column(name = "LENDING_TYPE_VALUE", length = 255)),
        @AttributeOverride(name = "id", column = @Column(name = "LENDING_TYPE_ID", length = 255))
    })
    public LendingType getLendingType() {
        return lendingType;
    }

    /**
     * Sets the value of the lendingType property.
     * 
     * @param value
     *     allowed object is
     *     {@link LendingType }
     *     
     */
    public void setLendingType(LendingType value) {
        this.lendingType = value;
    }

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

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

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

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

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

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

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

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

    public CountryElement withIso2Code(String value) {
        setIso2Code(value);
        return this;
    }

    public CountryElement withCountryName(String value) {
        setCountryName(value);
        return this;
    }

    public CountryElement withRegion(Region value) {
        setRegion(value);
        return this;
    }

    public CountryElement withAdminregion(Adminregion value) {
        setAdminregion(value);
        return this;
    }

    public CountryElement withIncomeLevel(IncomeLevel value) {
        setIncomeLevel(value);
        return this;
    }

    public CountryElement withLendingType(LendingType value) {
        setLendingType(value);
        return this;
    }

    public CountryElement withCapitalCity(String value) {
        setCapitalCity(value);
        return this;
    }

    public CountryElement withLongitude(String value) {
        setLongitude(value);
        return this;
    }

    public CountryElement withLatitude(String value) {
        setLatitude(value);
        return this;
    }

    public CountryElement withId(String value) {
        setId(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) {
        {
            String theIso2Code;
            theIso2Code = this.getIso2Code();
            strategy.appendField(locator, this, "iso2Code", buffer, theIso2Code);
        }
        {
            String theCountryName;
            theCountryName = this.getCountryName();
            strategy.appendField(locator, this, "countryName", buffer, theCountryName);
        }
        {
            Region theRegion;
            theRegion = this.getRegion();
            strategy.appendField(locator, this, "region", buffer, theRegion);
        }
        {
            Adminregion theAdminregion;
            theAdminregion = this.getAdminregion();
            strategy.appendField(locator, this, "adminregion", buffer, theAdminregion);
        }
        {
            IncomeLevel theIncomeLevel;
            theIncomeLevel = this.getIncomeLevel();
            strategy.appendField(locator, this, "incomeLevel", buffer, theIncomeLevel);
        }
        {
            LendingType theLendingType;
            theLendingType = this.getLendingType();
            strategy.appendField(locator, this, "lendingType", buffer, theLendingType);
        }
        {
            String theCapitalCity;
            theCapitalCity = this.getCapitalCity();
            strategy.appendField(locator, this, "capitalCity", buffer, theCapitalCity);
        }
        {
            String theLongitude;
            theLongitude = this.getLongitude();
            strategy.appendField(locator, this, "longitude", buffer, theLongitude);
        }
        {
            String theLatitude;
            theLatitude = this.getLatitude();
            strategy.appendField(locator, this, "latitude", buffer, theLatitude);
        }
        {
            String theId;
            theId = this.getId();
            strategy.appendField(locator, this, "id", buffer, theId);
        }
        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 CountryElement that = ((CountryElement) object);
        {
            String lhsIso2Code;
            lhsIso2Code = this.getIso2Code();
            String rhsIso2Code;
            rhsIso2Code = that.getIso2Code();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "iso2Code", lhsIso2Code), LocatorUtils.property(thatLocator, "iso2Code", rhsIso2Code), lhsIso2Code, rhsIso2Code)) {
                return false;
            }
        }
        {
            String lhsCountryName;
            lhsCountryName = this.getCountryName();
            String rhsCountryName;
            rhsCountryName = that.getCountryName();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "countryName", lhsCountryName), LocatorUtils.property(thatLocator, "countryName", rhsCountryName), lhsCountryName, rhsCountryName)) {
                return false;
            }
        }
        {
            Region lhsRegion;
            lhsRegion = this.getRegion();
            Region rhsRegion;
            rhsRegion = that.getRegion();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "region", lhsRegion), LocatorUtils.property(thatLocator, "region", rhsRegion), lhsRegion, rhsRegion)) {
                return false;
            }
        }
        {
            Adminregion lhsAdminregion;
            lhsAdminregion = this.getAdminregion();
            Adminregion rhsAdminregion;
            rhsAdminregion = that.getAdminregion();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "adminregion", lhsAdminregion), LocatorUtils.property(thatLocator, "adminregion", rhsAdminregion), lhsAdminregion, rhsAdminregion)) {
                return false;
            }
        }
        {
            IncomeLevel lhsIncomeLevel;
            lhsIncomeLevel = this.getIncomeLevel();
            IncomeLevel rhsIncomeLevel;
            rhsIncomeLevel = that.getIncomeLevel();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "incomeLevel", lhsIncomeLevel), LocatorUtils.property(thatLocator, "incomeLevel", rhsIncomeLevel), lhsIncomeLevel, rhsIncomeLevel)) {
                return false;
            }
        }
        {
            LendingType lhsLendingType;
            lhsLendingType = this.getLendingType();
            LendingType rhsLendingType;
            rhsLendingType = that.getLendingType();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "lendingType", lhsLendingType), LocatorUtils.property(thatLocator, "lendingType", rhsLendingType), lhsLendingType, rhsLendingType)) {
                return false;
            }
        }
        {
            String lhsCapitalCity;
            lhsCapitalCity = this.getCapitalCity();
            String rhsCapitalCity;
            rhsCapitalCity = that.getCapitalCity();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "capitalCity", lhsCapitalCity), LocatorUtils.property(thatLocator, "capitalCity", rhsCapitalCity), lhsCapitalCity, rhsCapitalCity)) {
                return false;
            }
        }
        {
            String lhsLongitude;
            lhsLongitude = this.getLongitude();
            String rhsLongitude;
            rhsLongitude = that.getLongitude();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "longitude", lhsLongitude), LocatorUtils.property(thatLocator, "longitude", rhsLongitude), lhsLongitude, rhsLongitude)) {
                return false;
            }
        }
        {
            String lhsLatitude;
            lhsLatitude = this.getLatitude();
            String rhsLatitude;
            rhsLatitude = that.getLatitude();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "latitude", lhsLatitude), LocatorUtils.property(thatLocator, "latitude", rhsLatitude), lhsLatitude, rhsLatitude)) {
                return false;
            }
        }
        {
            String lhsId;
            lhsId = this.getId();
            String rhsId;
            rhsId = that.getId();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId)) {
                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;
        {
            String theIso2Code;
            theIso2Code = this.getIso2Code();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "iso2Code", theIso2Code), currentHashCode, theIso2Code);
        }
        {
            String theCountryName;
            theCountryName = this.getCountryName();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "countryName", theCountryName), currentHashCode, theCountryName);
        }
        {
            Region theRegion;
            theRegion = this.getRegion();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "region", theRegion), currentHashCode, theRegion);
        }
        {
            Adminregion theAdminregion;
            theAdminregion = this.getAdminregion();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "adminregion", theAdminregion), currentHashCode, theAdminregion);
        }
        {
            IncomeLevel theIncomeLevel;
            theIncomeLevel = this.getIncomeLevel();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "incomeLevel", theIncomeLevel), currentHashCode, theIncomeLevel);
        }
        {
            LendingType theLendingType;
            theLendingType = this.getLendingType();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "lendingType", theLendingType), currentHashCode, theLendingType);
        }
        {
            String theCapitalCity;
            theCapitalCity = this.getCapitalCity();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "capitalCity", theCapitalCity), currentHashCode, theCapitalCity);
        }
        {
            String theLongitude;
            theLongitude = this.getLongitude();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "longitude", theLongitude), currentHashCode, theLongitude);
        }
        {
            String theLatitude;
            theLatitude = this.getLatitude();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "latitude", theLatitude), currentHashCode, theLatitude);
        }
        {
            String theId;
            theId = this.getId();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId);
        }
        return currentHashCode;
    }

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

}