VoteData.java
/*
* Copyright 2010 James Pether Sörling
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id$
* $HeadURL$
*/
// 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: 2019.02.24 at 11:40:13 PM CET
//
package com.hack23.cia.model.external.riksdagen.votering.impl;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hack23.cia.model.common.api.ModelObject;
import com.hack23.cia.model.common.impl.xml.XmlDateTypeAdapter;
/**
* The Class VoteData.
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VoteData", propOrder = {
"bankNumber",
"label",
"lastName",
"bornYear",
"firstName",
"place",
"gender",
"fullName",
"voteDate",
"party",
"rm",
"vote",
"ballotType",
"electoralRegion",
"electoralRegionNumber",
"embeddedId"
})
@Entity(name = "VoteData")
@Table(name = "VOTE_DATA")
@Inheritance(strategy = InheritanceType.JOINED)
public class VoteData
implements ModelObject
{
/**
*
*/
private static final long serialVersionUID = 1L;
/** The bank number. */
@XmlElement(name = "banknummer", required = true)
protected String bankNumber;
/** The label. */
@XmlElement(name = "beteckning", required = true)
protected String label;
/** The last name. */
@XmlElement(name = "efternamn", required = true)
protected String lastName;
/** The born year. */
@XmlElement(name = "fodd")
protected int bornYear;
/** The first name. */
@XmlElement(name = "fornamn", required = true)
protected String firstName;
/** The place. */
@XmlElement(name = "iort", required = true)
protected String place;
/** The gender. */
@XmlElement(name = "kon", required = true)
protected String gender;
/** The full name. */
@XmlElement(name = "namn", required = true)
protected String fullName;
/** The vote date. */
@XmlElement(name = "datum", required = true, type = String.class)
@XmlJavaTypeAdapter(XmlDateTypeAdapter.class)
@XmlSchemaType(name = "date")
protected Date voteDate;
/** The party. */
@XmlElement(name = "parti", required = true)
protected String party;
/** The rm. */
@XmlElement(required = true)
protected String rm;
/** The vote. */
@XmlElement(name = "rost", required = true)
@XmlSchemaType(name = "string")
protected VoteDecision vote;
/** The ballot type. */
@XmlElement(name = "votering", required = true)
@XmlSchemaType(name = "string")
protected BallotType ballotType;
/** The electoral region. */
@XmlElement(name = "valkrets", required = true)
protected String electoralRegion;
/** The electoral region number. */
@XmlElement(name = "valkretsnummer", required = true)
protected BigInteger electoralRegionNumber;
/** The embedded id. */
@XmlElement(required = true)
protected VoteDataEmbeddedId embeddedId;
/**
* Gets the bank number.
*
* @return the bank number
*/
@Basic
@Column(name = "BANK_NUMBER")
public String getBankNumber() {
return bankNumber;
}
/**
* Sets the bank number.
*
* @param value the new bank number
*/
public void setBankNumber(final String value) {
this.bankNumber = value;
}
/**
* Gets the label.
*
* @return the label
*/
@Basic
@Column(name = "LABEL")
public String getLabel() {
return label;
}
/**
* Sets the label.
*
* @param value the new label
*/
public void setLabel(final String value) {
this.label = value;
}
/**
* Gets the last name.
*
* @return the last name
*/
@Basic
@Column(name = "LAST_NAME")
public String getLastName() {
return lastName;
}
/**
* Sets the last name.
*
* @param value the new last name
*/
public void setLastName(final String value) {
this.lastName = value;
}
/**
* Gets the born year.
*
* @return the born year
*/
@Basic
@Column(name = "BORN_YEAR", precision = 10, scale = 0)
public int getBornYear() {
return bornYear;
}
/**
* Sets the born year.
*
* @param value the new born year
*/
public void setBornYear(final int value) {
this.bornYear = value;
}
/**
* Gets the first name.
*
* @return the first name
*/
@Basic
@Column(name = "FIRST_NAME")
public String getFirstName() {
return firstName;
}
/**
* Sets the first name.
*
* @param value the new first name
*/
public void setFirstName(final String value) {
this.firstName = value;
}
/**
* Gets the place.
*
* @return the place
*/
@Basic
@Column(name = "PLACE")
public String getPlace() {
return place;
}
/**
* Sets the place.
*
* @param value the new place
*/
public void setPlace(final String value) {
this.place = value;
}
/**
* Gets the gender.
*
* @return the gender
*/
@Basic
@Column(name = "GENDER")
public String getGender() {
return gender;
}
/**
* Sets the gender.
*
* @param value the new gender
*/
public void setGender(final String value) {
this.gender = value;
}
/**
* Gets the full name.
*
* @return the full name
*/
@Basic
@Column(name = "FULL_NAME")
public String getFullName() {
return fullName;
}
/**
* Sets the full name.
*
* @param value the new full name
*/
public void setFullName(final String value) {
this.fullName = value;
}
/**
* Gets the vote date.
*
* @return the vote date
*/
@Basic
@Column(name = "VOTE_DATE")
@Temporal(TemporalType.DATE)
public Date getVoteDate() {
return voteDate;
}
/**
* Sets the vote date.
*
* @param value the new vote date
*/
public void setVoteDate(final Date value) {
this.voteDate = value;
}
/**
* Gets the party.
*
* @return the party
*/
@Basic
@Column(name = "PARTY")
public String getParty() {
return party;
}
/**
* Sets the party.
*
* @param value the new party
*/
public void setParty(final String value) {
this.party = value;
}
/**
* Gets the rm.
*
* @return the rm
*/
@Basic
@Column(name = "RM")
public String getRm() {
return rm;
}
/**
* Sets the rm.
*
* @param value the new rm
*/
public void setRm(final String value) {
this.rm = value;
}
/**
* Gets the vote.
*
* @return the vote
*/
@Basic
@Column(name = "VOTE")
@Enumerated(EnumType.STRING)
public VoteDecision getVote() {
return vote;
}
/**
* Sets the vote.
*
* @param value the new vote
*/
public void setVote(final VoteDecision value) {
this.vote = value;
}
/**
* Gets the ballot type.
*
* @return the ballot type
*/
@Basic
@Column(name = "BALLOT_TYPE")
@Enumerated(EnumType.STRING)
public BallotType getBallotType() {
return ballotType;
}
/**
* Sets the ballot type.
*
* @param value the new ballot type
*/
public void setBallotType(final BallotType value) {
this.ballotType = value;
}
/**
* Gets the electoral region.
*
* @return the electoral region
*/
@Basic
@Column(name = "ELECTORAL_REGION")
public String getElectoralRegion() {
return electoralRegion;
}
/**
* Sets the electoral region.
*
* @param value the new electoral region
*/
public void setElectoralRegion(final String value) {
this.electoralRegion = value;
}
/**
* Gets the electoral region number.
*
* @return the electoral region number
*/
@Basic
@Column(name = "ELECTORAL_REGION_NUMBER", precision = 20)
public BigInteger getElectoralRegionNumber() {
return electoralRegionNumber;
}
/**
* Sets the electoral region number.
*
* @param value the new electoral region number
*/
public void setElectoralRegionNumber(final BigInteger value) {
this.electoralRegionNumber = value;
}
/**
* Gets the embedded id.
*
* @return the embedded id
*/
@EmbeddedId
@AttributeOverrides({
@AttributeOverride(name = "issue", column = @Column(name = "EMBEDDED_ID_ISSUE")),
@AttributeOverride(name = "ballotId", column = @Column(name = "EMBEDDED_ID_BALLOT_ID")),
@AttributeOverride(name = "intressentId", column = @Column(name = "EMBEDDED_ID_INTRESSENT_ID")),
@AttributeOverride(name = "concern", column = @Column(name = "EMBEDDED_ID_CONCERN"))
})
public VoteDataEmbeddedId getEmbeddedId() {
return embeddedId;
}
/**
* Sets the embedded id.
*
* @param value the new embedded id
*/
public void setEmbeddedId(final VoteDataEmbeddedId value) {
this.embeddedId = value;
}
/**
* With bank number.
*
* @param value the value
* @return the vote data
*/
public VoteData withBankNumber(final String value) {
setBankNumber(value);
return this;
}
/**
* With label.
*
* @param value the value
* @return the vote data
*/
public VoteData withLabel(final String value) {
setLabel(value);
return this;
}
/**
* With last name.
*
* @param value the value
* @return the vote data
*/
public VoteData withLastName(final String value) {
setLastName(value);
return this;
}
/**
* With born year.
*
* @param value the value
* @return the vote data
*/
public VoteData withBornYear(final int value) {
setBornYear(value);
return this;
}
/**
* With first name.
*
* @param value the value
* @return the vote data
*/
public VoteData withFirstName(final String value) {
setFirstName(value);
return this;
}
/**
* With place.
*
* @param value the value
* @return the vote data
*/
public VoteData withPlace(final String value) {
setPlace(value);
return this;
}
/**
* With gender.
*
* @param value the value
* @return the vote data
*/
public VoteData withGender(final String value) {
setGender(value);
return this;
}
/**
* With full name.
*
* @param value the value
* @return the vote data
*/
public VoteData withFullName(final String value) {
setFullName(value);
return this;
}
/**
* With vote date.
*
* @param value the value
* @return the vote data
*/
public VoteData withVoteDate(final Date value) {
setVoteDate(value);
return this;
}
/**
* With party.
*
* @param value the value
* @return the vote data
*/
public VoteData withParty(final String value) {
setParty(value);
return this;
}
/**
* With rm.
*
* @param value the value
* @return the vote data
*/
public VoteData withRm(final String value) {
setRm(value);
return this;
}
/**
* With vote.
*
* @param value the value
* @return the vote data
*/
public VoteData withVote(final VoteDecision value) {
setVote(value);
return this;
}
/**
* With ballot type.
*
* @param value the value
* @return the vote data
*/
public VoteData withBallotType(final BallotType value) {
setBallotType(value);
return this;
}
/**
* With electoral region.
*
* @param value the value
* @return the vote data
*/
public VoteData withElectoralRegion(final String value) {
setElectoralRegion(value);
return this;
}
/**
* With electoral region number.
*
* @param value the value
* @return the vote data
*/
public VoteData withElectoralRegionNumber(final BigInteger value) {
setElectoralRegionNumber(value);
return this;
}
/**
* With embedded id.
*
* @param value the value
* @return the vote data
*/
public VoteData withEmbeddedId(final VoteDataEmbeddedId value) {
setEmbeddedId(value);
return this;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public final String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(final Object object) {
return EqualsBuilder.reflectionEquals(this,object);
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public final int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
}