cyclic IDREF patched castor-1.1.1 source
[vamsas.git] / src / uk / ac / vamsas / objects / core / User.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package uk.ac.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class User.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class User extends uk.ac.vamsas.objects.core.AppData 
23 implements java.io.Serializable
24 {
25
26
27       //--------------------------/
28      //- Class/Member Variables -/
29     //--------------------------/
30
31     /**
32      * Field _fullname.
33      */
34     private java.lang.String _fullname;
35
36     /**
37      * Field _organization.
38      */
39     private java.lang.String _organization;
40
41
42       //----------------/
43      //- Constructors -/
44     //----------------/
45
46     public User() {
47         super();
48     }
49
50
51       //-----------/
52      //- Methods -/
53     //-----------/
54
55     /**
56      * Overrides the java.lang.Object.equals method.
57      * 
58      * @param obj
59      * @return true if the objects are equal.
60      */
61     public boolean equals(
62             final java.lang.Object obj) {
63         if ( this == obj )
64             return true;
65         
66         if (super.equals(obj)==false)
67             return false;
68         
69         if (obj instanceof User) {
70         
71             User temp = (User)obj;
72             if (this._fullname != null) {
73                 if (temp._fullname == null) return false;
74                 else if (!(this._fullname.equals(temp._fullname))) 
75                     return false;
76             }
77             else if (temp._fullname != null)
78                 return false;
79             if (this._organization != null) {
80                 if (temp._organization == null) return false;
81                 else if (!(this._organization.equals(temp._organization))) 
82                     return false;
83             }
84             else if (temp._organization != null)
85                 return false;
86             return true;
87         }
88         return false;
89     }
90
91     /**
92      * Returns the value of field 'fullname'.
93      * 
94      * @return the value of field 'Fullname'.
95      */
96     public java.lang.String getFullname(
97     ) {
98         return this._fullname;
99     }
100
101     /**
102      * Returns the value of field 'organization'.
103      * 
104      * @return the value of field 'Organization'.
105      */
106     public java.lang.String getOrganization(
107     ) {
108         return this._organization;
109     }
110
111     /**
112      * Overrides the java.lang.Object.hashCode method.
113      * <p>
114      * The following steps came from <b>Effective Java Programming
115      * Language Guide</b> by Joshua Bloch, Chapter 3
116      * 
117      * @return a hash code value for the object.
118      */
119     public int hashCode(
120     ) {
121         int result = super.hashCode();
122         
123         long tmp;
124         if (_fullname != null) {
125            result = 37 * result + _fullname.hashCode();
126         }
127         if (_organization != null) {
128            result = 37 * result + _organization.hashCode();
129         }
130         
131         return result;
132     }
133
134     /**
135      * Method isValid.
136      * 
137      * @return true if this object is valid according to the schema
138      */
139     public boolean isValid(
140     ) {
141         try {
142             validate();
143         } catch (org.exolab.castor.xml.ValidationException vex) {
144             return false;
145         }
146         return true;
147     }
148
149     /**
150      * 
151      * 
152      * @param out
153      * @throws org.exolab.castor.xml.MarshalException if object is
154      * null or if any SAXException is thrown during marshaling
155      * @throws org.exolab.castor.xml.ValidationException if this
156      * object is an invalid instance according to the schema
157      */
158     public void marshal(
159             final java.io.Writer out)
160     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
161         Marshaller.marshal(this, out);
162     }
163
164     /**
165      * 
166      * 
167      * @param handler
168      * @throws java.io.IOException if an IOException occurs during
169      * marshaling
170      * @throws org.exolab.castor.xml.ValidationException if this
171      * object is an invalid instance according to the schema
172      * @throws org.exolab.castor.xml.MarshalException if object is
173      * null or if any SAXException is thrown during marshaling
174      */
175     public void marshal(
176             final org.xml.sax.ContentHandler handler)
177     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
178         Marshaller.marshal(this, handler);
179     }
180
181     /**
182      * Sets the value of field 'fullname'.
183      * 
184      * @param fullname the value of field 'fullname'.
185      */
186     public void setFullname(
187             final java.lang.String fullname) {
188         this._fullname = fullname;
189     }
190
191     /**
192      * Sets the value of field 'organization'.
193      * 
194      * @param organization the value of field 'organization'.
195      */
196     public void setOrganization(
197             final java.lang.String organization) {
198         this._organization = organization;
199     }
200
201     /**
202      * Method unmarshal.
203      * 
204      * @param reader
205      * @throws org.exolab.castor.xml.MarshalException if object is
206      * null or if any SAXException is thrown during marshaling
207      * @throws org.exolab.castor.xml.ValidationException if this
208      * object is an invalid instance according to the schema
209      * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
210      */
211     public static uk.ac.vamsas.objects.core.AppData unmarshal(
212             final java.io.Reader reader)
213     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
214         return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.User.class, reader);
215     }
216
217     /**
218      * 
219      * 
220      * @throws org.exolab.castor.xml.ValidationException if this
221      * object is an invalid instance according to the schema
222      */
223     public void validate(
224     )
225     throws org.exolab.castor.xml.ValidationException {
226         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
227         validator.validate(this);
228     }
229
230 }