CommitteeProposalContainer.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:17 AM CEST 
//


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

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.persistence.CascadeType;
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.JoinColumn;
import javax.persistence.OneToMany;
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 CommitteeProposalContainer complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="CommitteeProposalContainer"&gt;
 *   &lt;complexContent&gt;
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *       &lt;sequence&gt;
 *         &lt;element name="utskottsforslag" type="{http://utskottsforslag.riksdagen.external.model.cia.hack23.com/impl}CommitteeProposalData" maxOccurs="unbounded"/&gt;
 *       &lt;/sequence&gt;
 *     &lt;/restriction&gt;
 *   &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CommitteeProposalContainer", propOrder = {
    "committeeProposalList"
})
@Entity(name = "CommitteeProposalContainer")
@Table(name = "COMMITTEE_PROPOSAL_CONTAINER")
@Inheritance(strategy = InheritanceType.JOINED)
public class CommitteeProposalContainer
    implements Serializable, ModelObject, Equals, HashCode, ToString
{

    @XmlElement(name = "utskottsforslag", required = true)
    protected List<CommitteeProposalData> committeeProposalList;
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
     * Gets the value of the committeeProposalList property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the committeeProposalList property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getCommitteeProposalList().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link CommitteeProposalData }
     * 
     * 
     */
    @OneToMany(targetEntity = CommitteeProposalData.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "COMMITTEE_PROPOSAL_LIST_COMM_0")
    public List<CommitteeProposalData> getCommitteeProposalList() {
        if (committeeProposalList == null) {
            committeeProposalList = new ArrayList<CommitteeProposalData>();
        }
        return this.committeeProposalList;
    }

    /**
     * 
     * 
     */
    public void setCommitteeProposalList(List<CommitteeProposalData> committeeProposalList) {
        this.committeeProposalList = committeeProposalList;
    }

    public CommitteeProposalContainer withCommitteeProposalList(CommitteeProposalData... values) {
        if (values!= null) {
            for (CommitteeProposalData value: values) {
                getCommitteeProposalList().add(value);
            }
        }
        return this;
    }

    public CommitteeProposalContainer withCommitteeProposalList(Collection<CommitteeProposalData> values) {
        if (values!= null) {
            getCommitteeProposalList().addAll(values);
        }
        return this;
    }

    public CommitteeProposalContainer withCommitteeProposalList(List<CommitteeProposalData> committeeProposalList) {
        setCommitteeProposalList(committeeProposalList);
        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) {
        {
            List<CommitteeProposalData> theCommitteeProposalList;
            theCommitteeProposalList = (((this.committeeProposalList!= null)&&(!this.committeeProposalList.isEmpty()))?this.getCommitteeProposalList():null);
            strategy.appendField(locator, this, "committeeProposalList", buffer, theCommitteeProposalList);
        }
        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 CommitteeProposalContainer that = ((CommitteeProposalContainer) object);
        {
            List<CommitteeProposalData> lhsCommitteeProposalList;
            lhsCommitteeProposalList = (((this.committeeProposalList!= null)&&(!this.committeeProposalList.isEmpty()))?this.getCommitteeProposalList():null);
            List<CommitteeProposalData> rhsCommitteeProposalList;
            rhsCommitteeProposalList = (((that.committeeProposalList!= null)&&(!that.committeeProposalList.isEmpty()))?that.getCommitteeProposalList():null);
            if (!strategy.equals(LocatorUtils.property(thisLocator, "committeeProposalList", lhsCommitteeProposalList), LocatorUtils.property(thatLocator, "committeeProposalList", rhsCommitteeProposalList), lhsCommitteeProposalList, rhsCommitteeProposalList)) {
                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;
        {
            List<CommitteeProposalData> theCommitteeProposalList;
            theCommitteeProposalList = (((this.committeeProposalList!= null)&&(!this.committeeProposalList.isEmpty()))?this.getCommitteeProposalList():null);
            currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "committeeProposalList", theCommitteeProposalList), currentHashCode, theCommitteeProposalList);
        }
        return currentHashCode;
    }

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

}