1
2
3
4
5
6
7
8
9 package com.hack23.cia.model.external.worldbank.countries.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.XmlAttribute;
20 import javax.xml.bind.annotation.XmlSchemaType;
21 import javax.xml.bind.annotation.XmlType;
22 import javax.xml.bind.annotation.XmlValue;
23 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
24 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
25 import com.hack23.cia.model.common.api.ModelObject;
26 import org.jvnet.jaxb2_commons.lang.Equals;
27 import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
28 import org.jvnet.jaxb2_commons.lang.HashCode;
29 import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
30 import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
31 import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
32 import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
33 import org.jvnet.jaxb2_commons.lang.ToString;
34 import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
35 import org.jvnet.jaxb2_commons.locator.ObjectLocator;
36 import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 @XmlAccessorType(XmlAccessType.FIELD)
57 @XmlType(name = "", propOrder = {
58 "value"
59 })
60 @Embeddable
61 public class IncomeLevel
62 implements Serializable, ModelObject, Equals, HashCode, ToString
63 {
64
65 private final static long serialVersionUID = 1L;
66 @XmlValue
67 protected IncomeLevelCategory value;
68 @XmlAttribute(name = "id", required = true)
69 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
70 @XmlSchemaType(name = "token")
71 protected String id;
72
73
74
75
76
77
78
79
80
81 @Basic
82 @Column(name = "VALUE_", length = 255)
83 @Enumerated(EnumType.STRING)
84 public IncomeLevelCategory getValue() {
85 return value;
86 }
87
88
89
90
91
92
93
94
95
96 public void setValue(IncomeLevelCategory value) {
97 this.value = value;
98 }
99
100
101
102
103
104
105
106
107
108 @Basic
109 @Column(name = "ID", length = 255)
110 public String getId() {
111 return id;
112 }
113
114
115
116
117
118
119
120
121
122 public void setId(String value) {
123 this.id = value;
124 }
125
126 public IncomeLevel withValue(IncomeLevelCategory value) {
127 setValue(value);
128 return this;
129 }
130
131 public IncomeLevel withId(String value) {
132 setId(value);
133 return this;
134 }
135
136 public String toString() {
137 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
138 final StringBuilder buffer = new StringBuilder();
139 append(null, buffer, strategy);
140 return buffer.toString();
141 }
142
143 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
144 strategy.appendStart(locator, this, buffer);
145 appendFields(locator, buffer, strategy);
146 strategy.appendEnd(locator, this, buffer);
147 return buffer;
148 }
149
150 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
151 {
152 IncomeLevelCategory theValue;
153 theValue = this.getValue();
154 strategy.appendField(locator, this, "value", buffer, theValue);
155 }
156 {
157 String theId;
158 theId = this.getId();
159 strategy.appendField(locator, this, "id", buffer, theId);
160 }
161 return buffer;
162 }
163
164 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
165 if ((object == null)||(this.getClass()!= object.getClass())) {
166 return false;
167 }
168 if (this == object) {
169 return true;
170 }
171 final IncomeLevel that = ((IncomeLevel) object);
172 {
173 IncomeLevelCategory lhsValue;
174 lhsValue = this.getValue();
175 IncomeLevelCategory rhsValue;
176 rhsValue = that.getValue();
177 if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) {
178 return false;
179 }
180 }
181 {
182 String lhsId;
183 lhsId = this.getId();
184 String rhsId;
185 rhsId = that.getId();
186 if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId)) {
187 return false;
188 }
189 }
190 return true;
191 }
192
193 public boolean equals(Object object) {
194 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
195 return equals(null, null, object, strategy);
196 }
197
198 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
199 int currentHashCode = 1;
200 {
201 IncomeLevelCategory theValue;
202 theValue = this.getValue();
203 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue);
204 }
205 {
206 String theId;
207 theId = this.getId();
208 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId);
209 }
210 return currentHashCode;
211 }
212
213 public int hashCode() {
214 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
215 return this.hashCode(null, strategy);
216 }
217
218 }