View Javadoc
1   //
2   // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 
3   // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
4   // Any modifications to this file will be lost upon recompilation of the source schema. 
5   // Generated on: 2017.04.23 at 07:21:22 PM CEST 
6   //
7   
8   
9   package com.hack23.cia.model.external.worldbank.indicators.impl;
10  
11  import java.io.Serializable;
12  import java.math.BigInteger;
13  import java.util.ArrayList;
14  import java.util.Collection;
15  import java.util.List;
16  import javax.persistence.Basic;
17  import javax.persistence.CascadeType;
18  import javax.persistence.Column;
19  import javax.persistence.Entity;
20  import javax.persistence.GeneratedValue;
21  import javax.persistence.GenerationType;
22  import javax.persistence.Id;
23  import javax.persistence.Inheritance;
24  import javax.persistence.InheritanceType;
25  import javax.persistence.JoinColumn;
26  import javax.persistence.OneToMany;
27  import javax.persistence.Table;
28  import javax.xml.bind.annotation.XmlAccessType;
29  import javax.xml.bind.annotation.XmlAccessorType;
30  import javax.xml.bind.annotation.XmlAttribute;
31  import javax.xml.bind.annotation.XmlElement;
32  import javax.xml.bind.annotation.XmlRootElement;
33  import javax.xml.bind.annotation.XmlType;
34  import com.hack23.cia.model.common.api.ModelObject;
35  import org.jvnet.jaxb2_commons.lang.Equals;
36  import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
37  import org.jvnet.jaxb2_commons.lang.HashCode;
38  import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
39  import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
40  import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
41  import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
42  import org.jvnet.jaxb2_commons.lang.ToString;
43  import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
44  import org.jvnet.jaxb2_commons.locator.ObjectLocator;
45  import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
46  
47  
48  /**
49   * <p>Java class for anonymous complex type.
50   * 
51   * <p>The following schema fragment specifies the expected content contained within this class.
52   * 
53   * <pre>
54   * &lt;complexType&gt;
55   *   &lt;complexContent&gt;
56   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
57   *       &lt;sequence&gt;
58   *         &lt;element ref="{http://indicators.worldbank.external.model.cia.hack23.com/impl}indicator" maxOccurs="unbounded"/&gt;
59   *       &lt;/sequence&gt;
60   *       &lt;attribute name="page" type="{http://www.w3.org/2001/XMLSchema}integer" /&gt;
61   *       &lt;attribute name="pages" type="{http://www.w3.org/2001/XMLSchema}integer" /&gt;
62   *       &lt;attribute name="per_page" type="{http://www.w3.org/2001/XMLSchema}integer" /&gt;
63   *       &lt;attribute name="total" type="{http://www.w3.org/2001/XMLSchema}integer" /&gt;
64   *     &lt;/restriction&gt;
65   *   &lt;/complexContent&gt;
66   * &lt;/complexType&gt;
67   * </pre>
68   * 
69   * 
70   */
71  @XmlAccessorType(XmlAccessType.FIELD)
72  @XmlType(name = "", propOrder = {
73      "indicator"
74  })
75  @XmlRootElement(name = "indicators")
76  @Entity(name = "IndicatorsElement")
77  @Table(name = "INDICATORS_ELEMENT")
78  @Inheritance(strategy = InheritanceType.JOINED)
79  public class IndicatorsElement
80      implements Serializable, ModelObject, Equals, HashCode, ToString
81  {
82  
83      @XmlElement(required = true)
84      protected List<IndicatorElement> indicator;
85      @XmlAttribute(name = "page")
86      protected BigInteger page;
87      @XmlAttribute(name = "pages")
88      protected BigInteger pages;
89      @XmlAttribute(name = "per_page")
90      protected BigInteger perPage;
91      @XmlAttribute(name = "total")
92      protected BigInteger total;
93      @XmlAttribute(name = "Hjid")
94      protected Long hjid;
95  
96      /**
97       * Gets the value of the indicator property.
98       * 
99       * <p>
100      * This accessor method returns a reference to the live list,
101      * not a snapshot. Therefore any modification you make to the
102      * returned list will be present inside the JAXB object.
103      * This is why there is not a <CODE>set</CODE> method for the indicator property.
104      * 
105      * <p>
106      * For example, to add a new item, do as follows:
107      * <pre>
108      *    getIndicator().add(newItem);
109      * </pre>
110      * 
111      * 
112      * <p>
113      * Objects of the following type(s) are allowed in the list
114      * {@link IndicatorElement }
115      * 
116      * 
117      */
118     @OneToMany(targetEntity = IndicatorElement.class, cascade = {
119         CascadeType.ALL
120     })
121     @JoinColumn(name = "INDICATOR__INDICATORS_ELEMEN_0")
122     public List<IndicatorElement> getIndicator() {
123         if (indicator == null) {
124             indicator = new ArrayList<IndicatorElement>();
125         }
126         return this.indicator;
127     }
128 
129     /**
130      * 
131      * 
132      */
133     public void setIndicator(List<IndicatorElement> indicator) {
134         this.indicator = indicator;
135     }
136 
137     /**
138      * Gets the value of the page property.
139      * 
140      * @return
141      *     possible object is
142      *     {@link BigInteger }
143      *     
144      */
145     @Basic
146     @Column(name = "PAGE", precision = 20, scale = 0)
147     public BigInteger getPage() {
148         return page;
149     }
150 
151     /**
152      * Sets the value of the page property.
153      * 
154      * @param value
155      *     allowed object is
156      *     {@link BigInteger }
157      *     
158      */
159     public void setPage(BigInteger value) {
160         this.page = value;
161     }
162 
163     /**
164      * Gets the value of the pages property.
165      * 
166      * @return
167      *     possible object is
168      *     {@link BigInteger }
169      *     
170      */
171     @Basic
172     @Column(name = "PAGES", precision = 20, scale = 0)
173     public BigInteger getPages() {
174         return pages;
175     }
176 
177     /**
178      * Sets the value of the pages property.
179      * 
180      * @param value
181      *     allowed object is
182      *     {@link BigInteger }
183      *     
184      */
185     public void setPages(BigInteger value) {
186         this.pages = value;
187     }
188 
189     /**
190      * Gets the value of the perPage property.
191      * 
192      * @return
193      *     possible object is
194      *     {@link BigInteger }
195      *     
196      */
197     @Basic
198     @Column(name = "PER_PAGE", precision = 20, scale = 0)
199     public BigInteger getPerPage() {
200         return perPage;
201     }
202 
203     /**
204      * Sets the value of the perPage property.
205      * 
206      * @param value
207      *     allowed object is
208      *     {@link BigInteger }
209      *     
210      */
211     public void setPerPage(BigInteger value) {
212         this.perPage = value;
213     }
214 
215     /**
216      * Gets the value of the total property.
217      * 
218      * @return
219      *     possible object is
220      *     {@link BigInteger }
221      *     
222      */
223     @Basic
224     @Column(name = "TOTAL", precision = 20, scale = 0)
225     public BigInteger getTotal() {
226         return total;
227     }
228 
229     /**
230      * Sets the value of the total property.
231      * 
232      * @param value
233      *     allowed object is
234      *     {@link BigInteger }
235      *     
236      */
237     public void setTotal(BigInteger value) {
238         this.total = value;
239     }
240 
241     public IndicatorsElement withIndicator(IndicatorElement... values) {
242         if (values!= null) {
243             for (IndicatorElement value: values) {
244                 getIndicator().add(value);
245             }
246         }
247         return this;
248     }
249 
250     public IndicatorsElement withIndicator(Collection<IndicatorElement> values) {
251         if (values!= null) {
252             getIndicator().addAll(values);
253         }
254         return this;
255     }
256 
257     public IndicatorsElement withIndicator(List<IndicatorElement> indicator) {
258         setIndicator(indicator);
259         return this;
260     }
261 
262     public IndicatorsElement withPage(BigInteger value) {
263         setPage(value);
264         return this;
265     }
266 
267     public IndicatorsElement withPages(BigInteger value) {
268         setPages(value);
269         return this;
270     }
271 
272     public IndicatorsElement withPerPage(BigInteger value) {
273         setPerPage(value);
274         return this;
275     }
276 
277     public IndicatorsElement withTotal(BigInteger value) {
278         setTotal(value);
279         return this;
280     }
281 
282     public String toString() {
283         final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
284         final StringBuilder buffer = new StringBuilder();
285         append(null, buffer, strategy);
286         return buffer.toString();
287     }
288 
289     public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
290         strategy.appendStart(locator, this, buffer);
291         appendFields(locator, buffer, strategy);
292         strategy.appendEnd(locator, this, buffer);
293         return buffer;
294     }
295 
296     public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
297         {
298             List<IndicatorElement> theIndicator;
299             theIndicator = (((this.indicator!= null)&&(!this.indicator.isEmpty()))?this.getIndicator():null);
300             strategy.appendField(locator, this, "indicator", buffer, theIndicator);
301         }
302         {
303             BigInteger thePage;
304             thePage = this.getPage();
305             strategy.appendField(locator, this, "page", buffer, thePage);
306         }
307         {
308             BigInteger thePages;
309             thePages = this.getPages();
310             strategy.appendField(locator, this, "pages", buffer, thePages);
311         }
312         {
313             BigInteger thePerPage;
314             thePerPage = this.getPerPage();
315             strategy.appendField(locator, this, "perPage", buffer, thePerPage);
316         }
317         {
318             BigInteger theTotal;
319             theTotal = this.getTotal();
320             strategy.appendField(locator, this, "total", buffer, theTotal);
321         }
322         return buffer;
323     }
324 
325     /**
326      * Gets the value of the hjid property.
327      * 
328      * @return
329      *     possible object is
330      *     {@link Long }
331      *     
332      */
333     @Id
334     @Column(name = "HJID")
335     @GeneratedValue(strategy = GenerationType.AUTO)
336     public Long getHjid() {
337         return hjid;
338     }
339 
340     /**
341      * Sets the value of the hjid property.
342      * 
343      * @param value
344      *     allowed object is
345      *     {@link Long }
346      *     
347      */
348     public void setHjid(Long value) {
349         this.hjid = value;
350     }
351 
352     public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
353         if ((object == null)||(this.getClass()!= object.getClass())) {
354             return false;
355         }
356         if (this == object) {
357             return true;
358         }
359         final IndicatorsElement that = ((IndicatorsElement) object);
360         {
361             List<IndicatorElement> lhsIndicator;
362             lhsIndicator = (((this.indicator!= null)&&(!this.indicator.isEmpty()))?this.getIndicator():null);
363             List<IndicatorElement> rhsIndicator;
364             rhsIndicator = (((that.indicator!= null)&&(!that.indicator.isEmpty()))?that.getIndicator():null);
365             if (!strategy.equals(LocatorUtils.property(thisLocator, "indicator", lhsIndicator), LocatorUtils.property(thatLocator, "indicator", rhsIndicator), lhsIndicator, rhsIndicator)) {
366                 return false;
367             }
368         }
369         {
370             BigInteger lhsPage;
371             lhsPage = this.getPage();
372             BigInteger rhsPage;
373             rhsPage = that.getPage();
374             if (!strategy.equals(LocatorUtils.property(thisLocator, "page", lhsPage), LocatorUtils.property(thatLocator, "page", rhsPage), lhsPage, rhsPage)) {
375                 return false;
376             }
377         }
378         {
379             BigInteger lhsPages;
380             lhsPages = this.getPages();
381             BigInteger rhsPages;
382             rhsPages = that.getPages();
383             if (!strategy.equals(LocatorUtils.property(thisLocator, "pages", lhsPages), LocatorUtils.property(thatLocator, "pages", rhsPages), lhsPages, rhsPages)) {
384                 return false;
385             }
386         }
387         {
388             BigInteger lhsPerPage;
389             lhsPerPage = this.getPerPage();
390             BigInteger rhsPerPage;
391             rhsPerPage = that.getPerPage();
392             if (!strategy.equals(LocatorUtils.property(thisLocator, "perPage", lhsPerPage), LocatorUtils.property(thatLocator, "perPage", rhsPerPage), lhsPerPage, rhsPerPage)) {
393                 return false;
394             }
395         }
396         {
397             BigInteger lhsTotal;
398             lhsTotal = this.getTotal();
399             BigInteger rhsTotal;
400             rhsTotal = that.getTotal();
401             if (!strategy.equals(LocatorUtils.property(thisLocator, "total", lhsTotal), LocatorUtils.property(thatLocator, "total", rhsTotal), lhsTotal, rhsTotal)) {
402                 return false;
403             }
404         }
405         return true;
406     }
407 
408     public boolean equals(Object object) {
409         final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
410         return equals(null, null, object, strategy);
411     }
412 
413     public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
414         int currentHashCode = 1;
415         {
416             List<IndicatorElement> theIndicator;
417             theIndicator = (((this.indicator!= null)&&(!this.indicator.isEmpty()))?this.getIndicator():null);
418             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "indicator", theIndicator), currentHashCode, theIndicator);
419         }
420         {
421             BigInteger thePage;
422             thePage = this.getPage();
423             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "page", thePage), currentHashCode, thePage);
424         }
425         {
426             BigInteger thePages;
427             thePages = this.getPages();
428             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "pages", thePages), currentHashCode, thePages);
429         }
430         {
431             BigInteger thePerPage;
432             thePerPage = this.getPerPage();
433             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "perPage", thePerPage), currentHashCode, thePerPage);
434         }
435         {
436             BigInteger theTotal;
437             theTotal = this.getTotal();
438             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "total", theTotal), currentHashCode, theTotal);
439         }
440         return currentHashCode;
441     }
442 
443     public int hashCode() {
444         final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
445         return this.hashCode(null, strategy);
446     }
447 
448 }