VoteListContainerElement.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 java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.persistence.Basic;
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 VoteListContainerElement complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="VoteListContainerElement">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="votering" type="{http://voteringlista.riksdagen.external.model.cia.hack23.com/impl}BallotDocumentElement" maxOccurs="unbounded"/>
* </sequence>
* <attribute name="gruppering" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="villkor" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="antal" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VoteListContainerElement", propOrder = {
"votering"
})
@Entity(name = "VoteListContainerElement")
@Table(name = "VOTE_LIST_CONTAINER_ELEMENT")
@Inheritance(strategy = InheritanceType.JOINED)
public class VoteListContainerElement
implements Serializable, ModelObject, Equals, HashCode, ToString
{
@XmlElement(required = true)
protected List<BallotDocumentElement> votering;
@XmlAttribute(name = "gruppering", required = true)
protected String grouping;
@XmlAttribute(name = "villkor", required = true)
protected String condition;
@XmlAttribute(name = "antal", required = true)
protected String numberValue;
@XmlAttribute(name = "Hjid")
protected Long hjid;
/**
* Gets the value of the votering 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 votering property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getVotering().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link BallotDocumentElement }
*
*
*/
@OneToMany(targetEntity = BallotDocumentElement.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "VOTERING_VOTE_LIST_CONTAINER_0")
public List<BallotDocumentElement> getVotering() {
if (votering == null) {
votering = new ArrayList<BallotDocumentElement>();
}
return this.votering;
}
/**
*
*
*/
public void setVotering(List<BallotDocumentElement> votering) {
this.votering = votering;
}
/**
* Gets the value of the grouping property.
*
* @return
* possible object is
* {@link String }
*
*/
@Basic
@Column(name = "GROUPING_", length = 255)
public String getGrouping() {
return grouping;
}
/**
* Sets the value of the grouping property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGrouping(String value) {
this.grouping = value;
}
/**
* Gets the value of the condition property.
*
* @return
* possible object is
* {@link String }
*
*/
@Basic
@Column(name = "CONDITION", length = 255)
public String getCondition() {
return condition;
}
/**
* Sets the value of the condition property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCondition(String value) {
this.condition = value;
}
/**
* Gets the value of the numberValue property.
*
* @return
* possible object is
* {@link String }
*
*/
@Basic
@Column(name = "NUMBER_VALUE", length = 255)
public String getNumberValue() {
return numberValue;
}
/**
* Sets the value of the numberValue property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNumberValue(String value) {
this.numberValue = value;
}
public VoteListContainerElement withVotering(BallotDocumentElement... values) {
if (values!= null) {
for (BallotDocumentElement value: values) {
getVotering().add(value);
}
}
return this;
}
public VoteListContainerElement withVotering(Collection<BallotDocumentElement> values) {
if (values!= null) {
getVotering().addAll(values);
}
return this;
}
public VoteListContainerElement withVotering(List<BallotDocumentElement> votering) {
setVotering(votering);
return this;
}
public VoteListContainerElement withGrouping(String value) {
setGrouping(value);
return this;
}
public VoteListContainerElement withCondition(String value) {
setCondition(value);
return this;
}
public VoteListContainerElement withNumberValue(String value) {
setNumberValue(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) {
{
List<BallotDocumentElement> theVotering;
theVotering = (((this.votering!= null)&&(!this.votering.isEmpty()))?this.getVotering():null);
strategy.appendField(locator, this, "votering", buffer, theVotering);
}
{
String theGrouping;
theGrouping = this.getGrouping();
strategy.appendField(locator, this, "grouping", buffer, theGrouping);
}
{
String theCondition;
theCondition = this.getCondition();
strategy.appendField(locator, this, "condition", buffer, theCondition);
}
{
String theNumberValue;
theNumberValue = this.getNumberValue();
strategy.appendField(locator, this, "numberValue", buffer, theNumberValue);
}
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 VoteListContainerElement that = ((VoteListContainerElement) object);
{
List<BallotDocumentElement> lhsVotering;
lhsVotering = (((this.votering!= null)&&(!this.votering.isEmpty()))?this.getVotering():null);
List<BallotDocumentElement> rhsVotering;
rhsVotering = (((that.votering!= null)&&(!that.votering.isEmpty()))?that.getVotering():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "votering", lhsVotering), LocatorUtils.property(thatLocator, "votering", rhsVotering), lhsVotering, rhsVotering)) {
return false;
}
}
{
String lhsGrouping;
lhsGrouping = this.getGrouping();
String rhsGrouping;
rhsGrouping = that.getGrouping();
if (!strategy.equals(LocatorUtils.property(thisLocator, "grouping", lhsGrouping), LocatorUtils.property(thatLocator, "grouping", rhsGrouping), lhsGrouping, rhsGrouping)) {
return false;
}
}
{
String lhsCondition;
lhsCondition = this.getCondition();
String rhsCondition;
rhsCondition = that.getCondition();
if (!strategy.equals(LocatorUtils.property(thisLocator, "condition", lhsCondition), LocatorUtils.property(thatLocator, "condition", rhsCondition), lhsCondition, rhsCondition)) {
return false;
}
}
{
String lhsNumberValue;
lhsNumberValue = this.getNumberValue();
String rhsNumberValue;
rhsNumberValue = that.getNumberValue();
if (!strategy.equals(LocatorUtils.property(thisLocator, "numberValue", lhsNumberValue), LocatorUtils.property(thatLocator, "numberValue", rhsNumberValue), lhsNumberValue, rhsNumberValue)) {
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<BallotDocumentElement> theVotering;
theVotering = (((this.votering!= null)&&(!this.votering.isEmpty()))?this.getVotering():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "votering", theVotering), currentHashCode, theVotering);
}
{
String theGrouping;
theGrouping = this.getGrouping();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "grouping", theGrouping), currentHashCode, theGrouping);
}
{
String theCondition;
theCondition = this.getCondition();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "condition", theCondition), currentHashCode, theCondition);
}
{
String theNumberValue;
theNumberValue = this.getNumberValue();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "numberValue", theNumberValue), currentHashCode, theNumberValue);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
}