SwedenCountyElectoralArea.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:56:21 AM CEST 
//


package com.hack23.cia.model.external.val.landstingvalkrets.impl;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
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.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;


/**
 * <p>Java class for SwedenCountyElectoralArea complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="SwedenCountyElectoralArea"&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence&gt;
 *         &lt;element name="valkretskod" type="{http://www.w3.org/2001/XMLSchema}integer"/&gt;
 *         &lt;element name="valkretsnamn" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
 *         &lt;element name="röstberättigade" type="{http://www.w3.org/2001/XMLSchema}integer"/&gt;
 *         &lt;element name="omgång1" type="{http://www.w3.org/2001/XMLSchema}integer"/&gt;
 *         &lt;element name="rest" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
 *         &lt;element name="omgång2" type="{http://www.w3.org/2001/XMLSchema}integer"/&gt;
 *         &lt;element name="mandat" type="{http://www.w3.org/2001/XMLSchema}integer"/&gt;
 *       &lt;/sequence&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SwedenCountyElectoralArea", propOrder = {
    "code",
    "electoralAreaName",
    "numberOfVoters",
    "firstRound",
    "rest",
    "secondRound",
    "numberOfSeats"
})
@Entity(name = "SwedenCountyElectoralArea")
@Table(name = "SWEDEN_COUNTY_ELECTORAL_AREA")
@Inheritance(strategy = InheritanceType.JOINED)
public class SwedenCountyElectoralArea
    implements Serializable, ModelObject, Equals, HashCode
{

    @XmlElement(name = "valkretskod", required = true)
    protected BigInteger code;
    @XmlElement(name = "valkretsnamn", required = true)
    protected String electoralAreaName;
    @XmlElement(name = "r\u00f6stber\u00e4ttigade", required = true)
    protected BigInteger numberOfVoters;
    @XmlElement(name = "omg\u00e5ng1", required = true)
    protected BigInteger firstRound;
    @XmlElement(required = true)
    protected String rest;
    @XmlElement(name = "omg\u00e5ng2", required = true)
    protected BigInteger secondRound;
    @XmlElement(name = "mandat", required = true)
    protected BigInteger numberOfSeats;
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
     * Gets the value of the code property.
     * 
     * @return
     *     possible object is
     *     {@link BigInteger }
     *     
     */
    @Basic
    @Column(name = "CODE", precision = 20, scale = 0)
    public BigInteger getCode() {
        return code;
    }

    /**
     * Sets the value of the code property.
     * 
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *     
     */
    public void setCode(BigInteger value) {
        this.code = value;
    }

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

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

    /**
     * Gets the value of the numberOfVoters property.
     * 
     * @return
     *     possible object is
     *     {@link BigInteger }
     *     
     */
    @Basic
    @Column(name = "NUMBER_OF_VOTERS", precision = 20, scale = 0)
    public BigInteger getNumberOfVoters() {
        return numberOfVoters;
    }

    /**
     * Sets the value of the numberOfVoters property.
     * 
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *     
     */
    public void setNumberOfVoters(BigInteger value) {
        this.numberOfVoters = value;
    }

    /**
     * Gets the value of the firstRound property.
     * 
     * @return
     *     possible object is
     *     {@link BigInteger }
     *     
     */
    @Basic
    @Column(name = "FIRST_ROUND", precision = 20, scale = 0)
    public BigInteger getFirstRound() {
        return firstRound;
    }

    /**
     * Sets the value of the firstRound property.
     * 
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *     
     */
    public void setFirstRound(BigInteger value) {
        this.firstRound = value;
    }

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

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

    /**
     * Gets the value of the secondRound property.
     * 
     * @return
     *     possible object is
     *     {@link BigInteger }
     *     
     */
    @Basic
    @Column(name = "SECOND_ROUND", precision = 20, scale = 0)
    public BigInteger getSecondRound() {
        return secondRound;
    }

    /**
     * Sets the value of the secondRound property.
     * 
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *     
     */
    public void setSecondRound(BigInteger value) {
        this.secondRound = value;
    }

    /**
     * Gets the value of the numberOfSeats property.
     * 
     * @return
     *     possible object is
     *     {@link BigInteger }
     *     
     */
    @Basic
    @Column(name = "NUMBER_OF_SEATS", precision = 20, scale = 0)
    public BigInteger getNumberOfSeats() {
        return numberOfSeats;
    }

    /**
     * Sets the value of the numberOfSeats property.
     * 
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *     
     */
    public void setNumberOfSeats(BigInteger value) {
        this.numberOfSeats = value;
    }

    /**
     * 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 SwedenCountyElectoralArea that = ((SwedenCountyElectoralArea) object);
        {
            BigInteger lhsCode;
            lhsCode = this.getCode();
            BigInteger rhsCode;
            rhsCode = that.getCode();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "code", lhsCode), LocatorUtils.property(thatLocator, "code", rhsCode), lhsCode, rhsCode)) {
                return false;
            }
        }
        {
            String lhsElectoralAreaName;
            lhsElectoralAreaName = this.getElectoralAreaName();
            String rhsElectoralAreaName;
            rhsElectoralAreaName = that.getElectoralAreaName();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "electoralAreaName", lhsElectoralAreaName), LocatorUtils.property(thatLocator, "electoralAreaName", rhsElectoralAreaName), lhsElectoralAreaName, rhsElectoralAreaName)) {
                return false;
            }
        }
        {
            BigInteger lhsNumberOfVoters;
            lhsNumberOfVoters = this.getNumberOfVoters();
            BigInteger rhsNumberOfVoters;
            rhsNumberOfVoters = that.getNumberOfVoters();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "numberOfVoters", lhsNumberOfVoters), LocatorUtils.property(thatLocator, "numberOfVoters", rhsNumberOfVoters), lhsNumberOfVoters, rhsNumberOfVoters)) {
                return false;
            }
        }
        {
            BigInteger lhsFirstRound;
            lhsFirstRound = this.getFirstRound();
            BigInteger rhsFirstRound;
            rhsFirstRound = that.getFirstRound();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "firstRound", lhsFirstRound), LocatorUtils.property(thatLocator, "firstRound", rhsFirstRound), lhsFirstRound, rhsFirstRound)) {
                return false;
            }
        }
        {
            String lhsRest;
            lhsRest = this.getRest();
            String rhsRest;
            rhsRest = that.getRest();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "rest", lhsRest), LocatorUtils.property(thatLocator, "rest", rhsRest), lhsRest, rhsRest)) {
                return false;
            }
        }
        {
            BigInteger lhsSecondRound;
            lhsSecondRound = this.getSecondRound();
            BigInteger rhsSecondRound;
            rhsSecondRound = that.getSecondRound();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "secondRound", lhsSecondRound), LocatorUtils.property(thatLocator, "secondRound", rhsSecondRound), lhsSecondRound, rhsSecondRound)) {
                return false;
            }
        }
        {
            BigInteger lhsNumberOfSeats;
            lhsNumberOfSeats = this.getNumberOfSeats();
            BigInteger rhsNumberOfSeats;
            rhsNumberOfSeats = that.getNumberOfSeats();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "numberOfSeats", lhsNumberOfSeats), LocatorUtils.property(thatLocator, "numberOfSeats", rhsNumberOfSeats), lhsNumberOfSeats, rhsNumberOfSeats)) {
                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;
        {
            BigInteger theCode;
            theCode = this.getCode();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "code", theCode), currentHashCode, theCode);
        }
        {
            String theElectoralAreaName;
            theElectoralAreaName = this.getElectoralAreaName();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "electoralAreaName", theElectoralAreaName), currentHashCode, theElectoralAreaName);
        }
        {
            BigInteger theNumberOfVoters;
            theNumberOfVoters = this.getNumberOfVoters();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "numberOfVoters", theNumberOfVoters), currentHashCode, theNumberOfVoters);
        }
        {
            BigInteger theFirstRound;
            theFirstRound = this.getFirstRound();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "firstRound", theFirstRound), currentHashCode, theFirstRound);
        }
        {
            String theRest;
            theRest = this.getRest();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "rest", theRest), currentHashCode, theRest);
        }
        {
            BigInteger theSecondRound;
            theSecondRound = this.getSecondRound();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "secondRound", theSecondRound), currentHashCode, theSecondRound);
        }
        {
            BigInteger theNumberOfSeats;
            theNumberOfSeats = this.getNumberOfSeats();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "numberOfSeats", theNumberOfSeats), currentHashCode, theNumberOfSeats);
        }
        return currentHashCode;
    }

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

}