1
2
3
4
5
6
7
8
9 package com.hack23.cia.model.external.riksdagen.votering.impl;
10
11 import java.io.Serializable;
12 import javax.persistence.Basic;
13 import javax.persistence.Column;
14 import javax.persistence.Embeddable;
15 import javax.persistence.EnumType;
16 import javax.persistence.Enumerated;
17 import javax.xml.bind.annotation.XmlAccessType;
18 import javax.xml.bind.annotation.XmlAccessorType;
19 import javax.xml.bind.annotation.XmlElement;
20 import javax.xml.bind.annotation.XmlSchemaType;
21 import javax.xml.bind.annotation.XmlType;
22 import com.hack23.cia.model.common.api.ModelObject;
23 import org.jvnet.jaxb2_commons.lang.Equals;
24 import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
25 import org.jvnet.jaxb2_commons.lang.HashCode;
26 import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
27 import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
28 import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
29 import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
30 import org.jvnet.jaxb2_commons.lang.ToString;
31 import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
32 import org.jvnet.jaxb2_commons.locator.ObjectLocator;
33 import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 @XmlAccessorType(XmlAccessType.FIELD)
59 @XmlType(name = "VoteDataEmbeddedId", propOrder = {
60 "issue",
61 "ballotId",
62 "intressentId",
63 "concern"
64 })
65 @Embeddable
66 public class VoteDataEmbeddedId
67 implements Serializable, ModelObject, Equals, HashCode, ToString
68 {
69
70 @XmlElement(name = "punkt", required = true)
71 protected String issue;
72 @XmlElement(name = "votering_id", required = true)
73 protected String ballotId;
74 @XmlElement(name = "intressent_id", required = true)
75 protected String intressentId;
76 @XmlElement(name = "avser", required = true)
77 @XmlSchemaType(name = "string")
78 protected VoteIssueType concern;
79
80
81
82
83
84
85
86
87
88 @Basic
89 @Column(name = "ISSUE", length = 255)
90 public String getIssue() {
91 return issue;
92 }
93
94
95
96
97
98
99
100
101
102 public void setIssue(String value) {
103 this.issue = value;
104 }
105
106
107
108
109
110
111
112
113
114 @Basic
115 @Column(name = "BALLOT_ID", length = 255)
116 public String getBallotId() {
117 return ballotId;
118 }
119
120
121
122
123
124
125
126
127
128 public void setBallotId(String value) {
129 this.ballotId = value;
130 }
131
132
133
134
135
136
137
138
139
140 @Basic
141 @Column(name = "INTRESSENT_ID", length = 255)
142 public String getIntressentId() {
143 return intressentId;
144 }
145
146
147
148
149
150
151
152
153
154 public void setIntressentId(String value) {
155 this.intressentId = value;
156 }
157
158
159
160
161
162
163
164
165
166 @Basic
167 @Column(name = "CONCERN", length = 255)
168 @Enumerated(EnumType.STRING)
169 public VoteIssueType getConcern() {
170 return concern;
171 }
172
173
174
175
176
177
178
179
180
181 public void setConcern(VoteIssueType value) {
182 this.concern = value;
183 }
184
185 public VoteDataEmbeddedId withIssue(String value) {
186 setIssue(value);
187 return this;
188 }
189
190 public VoteDataEmbeddedId withBallotId(String value) {
191 setBallotId(value);
192 return this;
193 }
194
195 public VoteDataEmbeddedId withIntressentId(String value) {
196 setIntressentId(value);
197 return this;
198 }
199
200 public VoteDataEmbeddedId withConcern(VoteIssueType value) {
201 setConcern(value);
202 return this;
203 }
204
205 public String toString() {
206 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
207 final StringBuilder buffer = new StringBuilder();
208 append(null, buffer, strategy);
209 return buffer.toString();
210 }
211
212 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
213 strategy.appendStart(locator, this, buffer);
214 appendFields(locator, buffer, strategy);
215 strategy.appendEnd(locator, this, buffer);
216 return buffer;
217 }
218
219 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
220 {
221 String theIssue;
222 theIssue = this.getIssue();
223 strategy.appendField(locator, this, "issue", buffer, theIssue);
224 }
225 {
226 String theBallotId;
227 theBallotId = this.getBallotId();
228 strategy.appendField(locator, this, "ballotId", buffer, theBallotId);
229 }
230 {
231 String theIntressentId;
232 theIntressentId = this.getIntressentId();
233 strategy.appendField(locator, this, "intressentId", buffer, theIntressentId);
234 }
235 {
236 VoteIssueType theConcern;
237 theConcern = this.getConcern();
238 strategy.appendField(locator, this, "concern", buffer, theConcern);
239 }
240 return buffer;
241 }
242
243 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
244 if ((object == null)||(this.getClass()!= object.getClass())) {
245 return false;
246 }
247 if (this == object) {
248 return true;
249 }
250 final VoteDataEmbeddedId that = ((VoteDataEmbeddedId) object);
251 {
252 String lhsIssue;
253 lhsIssue = this.getIssue();
254 String rhsIssue;
255 rhsIssue = that.getIssue();
256 if (!strategy.equals(LocatorUtils.property(thisLocator, "issue", lhsIssue), LocatorUtils.property(thatLocator, "issue", rhsIssue), lhsIssue, rhsIssue)) {
257 return false;
258 }
259 }
260 {
261 String lhsBallotId;
262 lhsBallotId = this.getBallotId();
263 String rhsBallotId;
264 rhsBallotId = that.getBallotId();
265 if (!strategy.equals(LocatorUtils.property(thisLocator, "ballotId", lhsBallotId), LocatorUtils.property(thatLocator, "ballotId", rhsBallotId), lhsBallotId, rhsBallotId)) {
266 return false;
267 }
268 }
269 {
270 String lhsIntressentId;
271 lhsIntressentId = this.getIntressentId();
272 String rhsIntressentId;
273 rhsIntressentId = that.getIntressentId();
274 if (!strategy.equals(LocatorUtils.property(thisLocator, "intressentId", lhsIntressentId), LocatorUtils.property(thatLocator, "intressentId", rhsIntressentId), lhsIntressentId, rhsIntressentId)) {
275 return false;
276 }
277 }
278 {
279 VoteIssueType lhsConcern;
280 lhsConcern = this.getConcern();
281 VoteIssueType rhsConcern;
282 rhsConcern = that.getConcern();
283 if (!strategy.equals(LocatorUtils.property(thisLocator, "concern", lhsConcern), LocatorUtils.property(thatLocator, "concern", rhsConcern), lhsConcern, rhsConcern)) {
284 return false;
285 }
286 }
287 return true;
288 }
289
290 public boolean equals(Object object) {
291 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
292 return equals(null, null, object, strategy);
293 }
294
295 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
296 int currentHashCode = 1;
297 {
298 String theIssue;
299 theIssue = this.getIssue();
300 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "issue", theIssue), currentHashCode, theIssue);
301 }
302 {
303 String theBallotId;
304 theBallotId = this.getBallotId();
305 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "ballotId", theBallotId), currentHashCode, theBallotId);
306 }
307 {
308 String theIntressentId;
309 theIntressentId = this.getIntressentId();
310 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "intressentId", theIntressentId), currentHashCode, theIntressentId);
311 }
312 {
313 VoteIssueType theConcern;
314 theConcern = this.getConcern();
315 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "concern", theConcern), currentHashCode, theConcern);
316 }
317 return currentHashCode;
318 }
319
320 public int hashCode() {
321 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
322 return this.hashCode(null, strategy);
323 }
324
325 }