8666d7187adf0a9266995bdc8a009e4be1572a3f
[vamsas.git] / src / org / vamsas / objects / core / DbRef.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package org.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import org.exolab.castor.xml.MarshalException;
19 import org.exolab.castor.xml.Marshaller;
20 import org.exolab.castor.xml.Unmarshaller;
21 import org.exolab.castor.xml.ValidationException;
22 import org.xml.sax.ContentHandler;
23
24 /**
25  * Class DbRef.
26  * 
27  * @version $Revision$ $Date$
28  */
29 public class DbRef extends org.vamsas.client.Vobject 
30 implements java.io.Serializable
31 {
32
33
34       //--------------------------/
35      //- Class/Member Variables -/
36     //--------------------------/
37
38     /**
39      * Field _source
40      */
41     private java.lang.String _source;
42
43     /**
44      * Field _version
45      */
46     private java.lang.String _version;
47
48     /**
49      * Field _accessionId
50      */
51     private java.lang.String _accessionId;
52
53     /**
54      * Field _id
55      */
56     private java.lang.String _id;
57
58
59       //----------------/
60      //- Constructors -/
61     //----------------/
62
63     public DbRef() 
64      {
65         super();
66     } //-- org.vamsas.objects.core.DbRef()
67
68
69       //-----------/
70      //- Methods -/
71     //-----------/
72
73     /**
74      * Note: hashCode() has not been overriden
75      * 
76      * @param obj
77      * @return boolean
78      */
79     public boolean equals(java.lang.Object obj)
80     {
81         if ( this == obj )
82             return true;
83         
84         if (super.equals(obj)==false)
85             return false;
86         
87         if (obj instanceof DbRef) {
88         
89             DbRef temp = (DbRef)obj;
90             if (this._source != null) {
91                 if (temp._source == null) return false;
92                 else if (!(this._source.equals(temp._source))) 
93                     return false;
94             }
95             else if (temp._source != null)
96                 return false;
97             if (this._version != null) {
98                 if (temp._version == null) return false;
99                 else if (!(this._version.equals(temp._version))) 
100                     return false;
101             }
102             else if (temp._version != null)
103                 return false;
104             if (this._accessionId != null) {
105                 if (temp._accessionId == null) return false;
106                 else if (!(this._accessionId.equals(temp._accessionId))) 
107                     return false;
108             }
109             else if (temp._accessionId != null)
110                 return false;
111             if (this._id != null) {
112                 if (temp._id == null) return false;
113                 else if (!(this._id.equals(temp._id))) 
114                     return false;
115             }
116             else if (temp._id != null)
117                 return false;
118             return true;
119         }
120         return false;
121     } //-- boolean equals(java.lang.Object) 
122
123     /**
124      * Returns the value of field 'accessionId'.
125      * 
126      * @return String
127      * @return the value of field 'accessionId'.
128      */
129     public java.lang.String getAccessionId()
130     {
131         return this._accessionId;
132     } //-- java.lang.String getAccessionId() 
133
134     /**
135      * Returns the value of field 'id'.
136      * 
137      * @return String
138      * @return the value of field 'id'.
139      */
140     public java.lang.String getId()
141     {
142         return this._id;
143     } //-- java.lang.String getId() 
144
145     /**
146      * Returns the value of field 'source'.
147      * 
148      * @return String
149      * @return the value of field 'source'.
150      */
151     public java.lang.String getSource()
152     {
153         return this._source;
154     } //-- java.lang.String getSource() 
155
156     /**
157      * Returns the value of field 'version'.
158      * 
159      * @return String
160      * @return the value of field 'version'.
161      */
162     public java.lang.String getVersion()
163     {
164         return this._version;
165     } //-- java.lang.String getVersion() 
166
167     /**
168      * Method isValid
169      * 
170      * 
171      * 
172      * @return boolean
173      */
174     public boolean isValid()
175     {
176         try {
177             validate();
178         }
179         catch (org.exolab.castor.xml.ValidationException vex) {
180             return false;
181         }
182         return true;
183     } //-- boolean isValid() 
184
185     /**
186      * Method marshal
187      * 
188      * 
189      * 
190      * @param out
191      */
192     public void marshal(java.io.Writer out)
193         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
194     {
195         
196         Marshaller.marshal(this, out);
197     } //-- void marshal(java.io.Writer) 
198
199     /**
200      * Method marshal
201      * 
202      * 
203      * 
204      * @param handler
205      */
206     public void marshal(org.xml.sax.ContentHandler handler)
207         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
208     {
209         
210         Marshaller.marshal(this, handler);
211     } //-- void marshal(org.xml.sax.ContentHandler) 
212
213     /**
214      * Sets the value of field 'accessionId'.
215      * 
216      * @param accessionId the value of field 'accessionId'.
217      */
218     public void setAccessionId(java.lang.String accessionId)
219     {
220         this._accessionId = accessionId;
221     } //-- void setAccessionId(java.lang.String) 
222
223     /**
224      * Sets the value of field 'id'.
225      * 
226      * @param id the value of field 'id'.
227      */
228     public void setId(java.lang.String id)
229     {
230         this._id = id;
231     } //-- void setId(java.lang.String) 
232
233     /**
234      * Sets the value of field 'source'.
235      * 
236      * @param source the value of field 'source'.
237      */
238     public void setSource(java.lang.String source)
239     {
240         this._source = source;
241     } //-- void setSource(java.lang.String) 
242
243     /**
244      * Sets the value of field 'version'.
245      * 
246      * @param version the value of field 'version'.
247      */
248     public void setVersion(java.lang.String version)
249     {
250         this._version = version;
251     } //-- void setVersion(java.lang.String) 
252
253     /**
254      * Method unmarshal
255      * 
256      * 
257      * 
258      * @param reader
259      * @return DbRef
260      */
261     public static org.vamsas.objects.core.DbRef unmarshal(java.io.Reader reader)
262         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
263     {
264         return (org.vamsas.objects.core.DbRef) Unmarshaller.unmarshal(org.vamsas.objects.core.DbRef.class, reader);
265     } //-- org.vamsas.objects.core.DbRef unmarshal(java.io.Reader) 
266
267     /**
268      * Method validate
269      * 
270      */
271     public void validate()
272         throws org.exolab.castor.xml.ValidationException
273     {
274         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
275         validator.validate(this);
276     } //-- void validate() 
277
278 }