BallotDocumentElement.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:58:51 AM CEST 
//


package com.hack23.cia.model.external.riksdagen.voteringlista.impl;

import java.io.Serializable;
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.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 BallotDocumentElement complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="BallotDocumentElement"&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence&gt;
 *         &lt;element name="votering_id" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
 *         &lt;element name="Ja" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
 *         &lt;element name="Nej" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
 *         &lt;element name="Frånvarande" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
 *         &lt;element name="Avstår" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
 *       &lt;/sequence&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BallotDocumentElement", propOrder = {
    "ballotId",
    "yesVotes",
    "noVotes",
    "absentVotes",
    "abstainedVotes"
})
@Entity(name = "BallotDocumentElement")
@Table(name = "BALLOT_DOCUMENT_ELEMENT")
@Inheritance(strategy = InheritanceType.JOINED)
public class BallotDocumentElement
    implements Serializable, ModelObject, Equals, HashCode, ToString
{

    @XmlElement(name = "votering_id", required = true)
    protected String ballotId;
    @XmlElement(name = "Ja")
    protected int yesVotes;
    @XmlElement(name = "Nej")
    protected int noVotes;
    @XmlElement(name = "Fr\u00e5nvarande")
    protected int absentVotes;
    @XmlElement(name = "Avst\u00e5r")
    protected int abstainedVotes;
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

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

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

    /**
     * Gets the value of the yesVotes property.
     * 
     */
    @Basic
    @Column(name = "YES_VOTES", precision = 10, scale = 0)
    public int getYesVotes() {
        return yesVotes;
    }

    /**
     * Sets the value of the yesVotes property.
     * 
     */
    public void setYesVotes(int value) {
        this.yesVotes = value;
    }

    /**
     * Gets the value of the noVotes property.
     * 
     */
    @Basic
    @Column(name = "NO_VOTES", precision = 10, scale = 0)
    public int getNoVotes() {
        return noVotes;
    }

    /**
     * Sets the value of the noVotes property.
     * 
     */
    public void setNoVotes(int value) {
        this.noVotes = value;
    }

    /**
     * Gets the value of the absentVotes property.
     * 
     */
    @Basic
    @Column(name = "ABSENT_VOTES", precision = 10, scale = 0)
    public int getAbsentVotes() {
        return absentVotes;
    }

    /**
     * Sets the value of the absentVotes property.
     * 
     */
    public void setAbsentVotes(int value) {
        this.absentVotes = value;
    }

    /**
     * Gets the value of the abstainedVotes property.
     * 
     */
    @Basic
    @Column(name = "ABSTAINED_VOTES", precision = 10, scale = 0)
    public int getAbstainedVotes() {
        return abstainedVotes;
    }

    /**
     * Sets the value of the abstainedVotes property.
     * 
     */
    public void setAbstainedVotes(int value) {
        this.abstainedVotes = value;
    }

    public BallotDocumentElement withBallotId(String value) {
        setBallotId(value);
        return this;
    }

    public BallotDocumentElement withYesVotes(int value) {
        setYesVotes(value);
        return this;
    }

    public BallotDocumentElement withNoVotes(int value) {
        setNoVotes(value);
        return this;
    }

    public BallotDocumentElement withAbsentVotes(int value) {
        setAbsentVotes(value);
        return this;
    }

    public BallotDocumentElement withAbstainedVotes(int value) {
        setAbstainedVotes(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 theBallotId;
            theBallotId = this.getBallotId();
            strategy.appendField(locator, this, "ballotId", buffer, theBallotId);
        }
        {
            int theYesVotes;
            theYesVotes = this.getYesVotes();
            strategy.appendField(locator, this, "yesVotes", buffer, theYesVotes);
        }
        {
            int theNoVotes;
            theNoVotes = this.getNoVotes();
            strategy.appendField(locator, this, "noVotes", buffer, theNoVotes);
        }
        {
            int theAbsentVotes;
            theAbsentVotes = this.getAbsentVotes();
            strategy.appendField(locator, this, "absentVotes", buffer, theAbsentVotes);
        }
        {
            int theAbstainedVotes;
            theAbstainedVotes = this.getAbstainedVotes();
            strategy.appendField(locator, this, "abstainedVotes", buffer, theAbstainedVotes);
        }
        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 BallotDocumentElement that = ((BallotDocumentElement) object);
        {
            String lhsBallotId;
            lhsBallotId = this.getBallotId();
            String rhsBallotId;
            rhsBallotId = that.getBallotId();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "ballotId", lhsBallotId), LocatorUtils.property(thatLocator, "ballotId", rhsBallotId), lhsBallotId, rhsBallotId)) {
                return false;
            }
        }
        {
            int lhsYesVotes;
            lhsYesVotes = this.getYesVotes();
            int rhsYesVotes;
            rhsYesVotes = that.getYesVotes();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "yesVotes", lhsYesVotes), LocatorUtils.property(thatLocator, "yesVotes", rhsYesVotes), lhsYesVotes, rhsYesVotes)) {
                return false;
            }
        }
        {
            int lhsNoVotes;
            lhsNoVotes = this.getNoVotes();
            int rhsNoVotes;
            rhsNoVotes = that.getNoVotes();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "noVotes", lhsNoVotes), LocatorUtils.property(thatLocator, "noVotes", rhsNoVotes), lhsNoVotes, rhsNoVotes)) {
                return false;
            }
        }
        {
            int lhsAbsentVotes;
            lhsAbsentVotes = this.getAbsentVotes();
            int rhsAbsentVotes;
            rhsAbsentVotes = that.getAbsentVotes();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "absentVotes", lhsAbsentVotes), LocatorUtils.property(thatLocator, "absentVotes", rhsAbsentVotes), lhsAbsentVotes, rhsAbsentVotes)) {
                return false;
            }
        }
        {
            int lhsAbstainedVotes;
            lhsAbstainedVotes = this.getAbstainedVotes();
            int rhsAbstainedVotes;
            rhsAbstainedVotes = that.getAbstainedVotes();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "abstainedVotes", lhsAbstainedVotes), LocatorUtils.property(thatLocator, "abstainedVotes", rhsAbstainedVotes), lhsAbstainedVotes, rhsAbstainedVotes)) {
                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 theBallotId;
            theBallotId = this.getBallotId();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "ballotId", theBallotId), currentHashCode, theBallotId);
        }
        {
            int theYesVotes;
            theYesVotes = this.getYesVotes();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "yesVotes", theYesVotes), currentHashCode, theYesVotes);
        }
        {
            int theNoVotes;
            theNoVotes = this.getNoVotes();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "noVotes", theNoVotes), currentHashCode, theNoVotes);
        }
        {
            int theAbsentVotes;
            theAbsentVotes = this.getAbsentVotes();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "absentVotes", theAbsentVotes), currentHashCode, theAbsentVotes);
        }
        {
            int theAbstainedVotes;
            theAbstainedVotes = this.getAbstainedVotes();
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "abstainedVotes", theAbstainedVotes), currentHashCode, theAbstainedVotes);
        }
        return currentHashCode;
    }

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

}