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:23:18 PM CEST 
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   * <p>Java class for anonymous complex type.
41   * 
42   * <p>The following schema fragment specifies the expected content contained within this class.
43   * 
44   * <pre>
45   * &lt;complexType&gt;
46   *   &lt;simpleContent&gt;
47   *     &lt;extension base="&lt;http://countries.worldbank.external.model.cia.hack23.com/impl&gt;AdminRegionCategory"&gt;
48   *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}token" /&gt;
49   *     &lt;/extension&gt;
50   *   &lt;/simpleContent&gt;
51   * &lt;/complexType&gt;
52   * </pre>
53   * 
54   * 
55   */
56  @XmlAccessorType(XmlAccessType.FIELD)
57  @XmlType(name = "", propOrder = {
58      "value"
59  })
60  @Embeddable
61  public class Adminregion
62      implements Serializable, ModelObject, Equals, HashCode, ToString
63  {
64  
65      private final static long serialVersionUID = 1L;
66      @XmlValue
67      protected AdminRegionCategory value;
68      @XmlAttribute(name = "id", required = true)
69      @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
70      @XmlSchemaType(name = "token")
71      protected String id;
72  
73      /**
74       * Gets the value of the value property.
75       * 
76       * @return
77       *     possible object is
78       *     {@link AdminRegionCategory }
79       *     
80       */
81      @Basic
82      @Column(name = "VALUE_", length = 255)
83      @Enumerated(EnumType.STRING)
84      public AdminRegionCategory getValue() {
85          return value;
86      }
87  
88      /**
89       * Sets the value of the value property.
90       * 
91       * @param value
92       *     allowed object is
93       *     {@link AdminRegionCategory }
94       *     
95       */
96      public void setValue(AdminRegionCategory value) {
97          this.value = value;
98      }
99  
100     /**
101      * Gets the value of the id property.
102      * 
103      * @return
104      *     possible object is
105      *     {@link String }
106      *     
107      */
108     @Basic
109     @Column(name = "ID", length = 255)
110     public String getId() {
111         return id;
112     }
113 
114     /**
115      * Sets the value of the id property.
116      * 
117      * @param value
118      *     allowed object is
119      *     {@link String }
120      *     
121      */
122     public void setId(String value) {
123         this.id = value;
124     }
125 
126     public Adminregion withValue(AdminRegionCategory value) {
127         setValue(value);
128         return this;
129     }
130 
131     public Adminregion 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             AdminRegionCategory 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 Adminregion that = ((Adminregion) object);
172         {
173             AdminRegionCategory lhsValue;
174             lhsValue = this.getValue();
175             AdminRegionCategory 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             AdminRegionCategory 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 }