2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package uk.ac.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class User extends uk.ac.vamsas.objects.core.AppData
23 implements java.io.Serializable
27 //--------------------------/
28 //- Class/Member Variables -/
29 //--------------------------/
34 private java.lang.String _fullname;
37 * Field _organization.
39 private java.lang.String _organization;
56 * Overrides the java.lang.Object.equals method.
59 * @return true if the objects are equal.
61 public boolean equals(
62 final java.lang.Object obj) {
66 if (super.equals(obj)==false)
69 if (obj instanceof User) {
71 User temp = (User)obj;
74 if (this._fullname != null) {
75 if (temp._fullname == null) return false;
76 if (this._fullname != temp._fullname) {
77 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._fullname);
78 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._fullname);
79 if (thcycle!=tmcycle) {
80 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname); };
81 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname); };
85 if (!this._fullname.equals(temp._fullname)) {
86 org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname);
87 org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname);
90 org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname);
91 org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname);
94 } else if (temp._fullname != null)
96 if (this._organization != null) {
97 if (temp._organization == null) return false;
98 if (this._organization != temp._organization) {
99 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._organization);
100 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._organization);
101 if (thcycle!=tmcycle) {
102 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._organization); };
103 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization); };
107 if (!this._organization.equals(temp._organization)) {
108 org.castor.util.CycleBreaker.releaseCycleHandle(this._organization);
109 org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization);
112 org.castor.util.CycleBreaker.releaseCycleHandle(this._organization);
113 org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization);
116 } else if (temp._organization != null)
124 * Returns the value of field 'fullname'.
126 * @return the value of field 'Fullname'.
128 public java.lang.String getFullname(
130 return this._fullname;
134 * Returns the value of field 'organization'.
136 * @return the value of field 'Organization'.
138 public java.lang.String getOrganization(
140 return this._organization;
144 * Overrides the java.lang.Object.hashCode method.
146 * The following steps came from <b>Effective Java Programming
147 * Language Guide</b> by Joshua Bloch, Chapter 3
149 * @return a hash code value for the object.
153 int result = super.hashCode();
156 if (_fullname != null
157 && !org.castor.util.CycleBreaker.startingToCycle(_fullname)) {
158 result = 37 * result + _fullname.hashCode();
159 org.castor.util.CycleBreaker.releaseCycleHandle(_fullname);
161 if (_organization != null
162 && !org.castor.util.CycleBreaker.startingToCycle(_organization)) {
163 result = 37 * result + _organization.hashCode();
164 org.castor.util.CycleBreaker.releaseCycleHandle(_organization);
173 * @return true if this object is valid according to the schema
175 public boolean isValid(
179 } catch (org.exolab.castor.xml.ValidationException vex) {
189 * @throws org.exolab.castor.xml.MarshalException if object is
190 * null or if any SAXException is thrown during marshaling
191 * @throws org.exolab.castor.xml.ValidationException if this
192 * object is an invalid instance according to the schema
195 final java.io.Writer out)
196 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
197 Marshaller.marshal(this, out);
204 * @throws java.io.IOException if an IOException occurs during
206 * @throws org.exolab.castor.xml.ValidationException if this
207 * object is an invalid instance according to the schema
208 * @throws org.exolab.castor.xml.MarshalException if object is
209 * null or if any SAXException is thrown during marshaling
212 final org.xml.sax.ContentHandler handler)
213 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
214 Marshaller.marshal(this, handler);
218 * Sets the value of field 'fullname'.
220 * @param fullname the value of field 'fullname'.
222 public void setFullname(
223 final java.lang.String fullname) {
224 this._fullname = fullname;
228 * Sets the value of field 'organization'.
230 * @param organization the value of field 'organization'.
232 public void setOrganization(
233 final java.lang.String organization) {
234 this._organization = organization;
241 * @throws org.exolab.castor.xml.MarshalException if object is
242 * null or if any SAXException is thrown during marshaling
243 * @throws org.exolab.castor.xml.ValidationException if this
244 * object is an invalid instance according to the schema
245 * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
247 public static uk.ac.vamsas.objects.core.AppData unmarshal(
248 final java.io.Reader reader)
249 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
250 return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.User.class, reader);
256 * @throws org.exolab.castor.xml.ValidationException if this
257 * object is an invalid instance according to the schema
259 public void validate(
261 throws org.exolab.castor.xml.ValidationException {
262 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
263 validator.validate(this);