821163d607d7aafe304ff9993a7faa7efe0d3e15
[jalview.git] / src / uk / ac / ebi / picr / model / CrossReference.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3  * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 package uk.ac.ebi.picr.model;
19
20 public class CrossReference implements java.io.Serializable
21 {
22   private java.lang.String accession;
23
24   private java.lang.String accessionVersion;
25
26   private java.lang.String databaseDescription;
27
28   private java.lang.String databaseName;
29
30   private java.util.Calendar dateAdded;
31
32   private java.util.Calendar dateDeleted;
33
34   private boolean deleted;
35
36   private java.lang.String gi;
37
38   private java.lang.String taxonId;
39
40   public CrossReference()
41   {
42   }
43
44   public CrossReference(java.lang.String accession,
45           java.lang.String accessionVersion,
46           java.lang.String databaseDescription,
47           java.lang.String databaseName, java.util.Calendar dateAdded,
48           java.util.Calendar dateDeleted, boolean deleted,
49           java.lang.String gi, java.lang.String taxonId)
50   {
51     this.accession = accession;
52     this.accessionVersion = accessionVersion;
53     this.databaseDescription = databaseDescription;
54     this.databaseName = databaseName;
55     this.dateAdded = dateAdded;
56     this.dateDeleted = dateDeleted;
57     this.deleted = deleted;
58     this.gi = gi;
59     this.taxonId = taxonId;
60   }
61
62   /**
63    * Gets the accession value for this CrossReference.
64    * 
65    * @return accession
66    */
67   public java.lang.String getAccession()
68   {
69     return accession;
70   }
71
72   /**
73    * Sets the accession value for this CrossReference.
74    * 
75    * @param accession
76    */
77   public void setAccession(java.lang.String accession)
78   {
79     this.accession = accession;
80   }
81
82   /**
83    * Gets the accessionVersion value for this CrossReference.
84    * 
85    * @return accessionVersion
86    */
87   public java.lang.String getAccessionVersion()
88   {
89     return accessionVersion;
90   }
91
92   /**
93    * Sets the accessionVersion value for this CrossReference.
94    * 
95    * @param accessionVersion
96    */
97   public void setAccessionVersion(java.lang.String accessionVersion)
98   {
99     this.accessionVersion = accessionVersion;
100   }
101
102   /**
103    * Gets the databaseDescription value for this CrossReference.
104    * 
105    * @return databaseDescription
106    */
107   public java.lang.String getDatabaseDescription()
108   {
109     return databaseDescription;
110   }
111
112   /**
113    * Sets the databaseDescription value for this CrossReference.
114    * 
115    * @param databaseDescription
116    */
117   public void setDatabaseDescription(java.lang.String databaseDescription)
118   {
119     this.databaseDescription = databaseDescription;
120   }
121
122   /**
123    * Gets the databaseName value for this CrossReference.
124    * 
125    * @return databaseName
126    */
127   public java.lang.String getDatabaseName()
128   {
129     return databaseName;
130   }
131
132   /**
133    * Sets the databaseName value for this CrossReference.
134    * 
135    * @param databaseName
136    */
137   public void setDatabaseName(java.lang.String databaseName)
138   {
139     this.databaseName = databaseName;
140   }
141
142   /**
143    * Gets the dateAdded value for this CrossReference.
144    * 
145    * @return dateAdded
146    */
147   public java.util.Calendar getDateAdded()
148   {
149     return dateAdded;
150   }
151
152   /**
153    * Sets the dateAdded value for this CrossReference.
154    * 
155    * @param dateAdded
156    */
157   public void setDateAdded(java.util.Calendar dateAdded)
158   {
159     this.dateAdded = dateAdded;
160   }
161
162   /**
163    * Gets the dateDeleted value for this CrossReference.
164    * 
165    * @return dateDeleted
166    */
167   public java.util.Calendar getDateDeleted()
168   {
169     return dateDeleted;
170   }
171
172   /**
173    * Sets the dateDeleted value for this CrossReference.
174    * 
175    * @param dateDeleted
176    */
177   public void setDateDeleted(java.util.Calendar dateDeleted)
178   {
179     this.dateDeleted = dateDeleted;
180   }
181
182   /**
183    * Gets the deleted value for this CrossReference.
184    * 
185    * @return deleted
186    */
187   public boolean isDeleted()
188   {
189     return deleted;
190   }
191
192   /**
193    * Sets the deleted value for this CrossReference.
194    * 
195    * @param deleted
196    */
197   public void setDeleted(boolean deleted)
198   {
199     this.deleted = deleted;
200   }
201
202   /**
203    * Gets the gi value for this CrossReference.
204    * 
205    * @return gi
206    */
207   public java.lang.String getGi()
208   {
209     return gi;
210   }
211
212   /**
213    * Sets the gi value for this CrossReference.
214    * 
215    * @param gi
216    */
217   public void setGi(java.lang.String gi)
218   {
219     this.gi = gi;
220   }
221
222   /**
223    * Gets the taxonId value for this CrossReference.
224    * 
225    * @return taxonId
226    */
227   public java.lang.String getTaxonId()
228   {
229     return taxonId;
230   }
231
232   /**
233    * Sets the taxonId value for this CrossReference.
234    * 
235    * @param taxonId
236    */
237   public void setTaxonId(java.lang.String taxonId)
238   {
239     this.taxonId = taxonId;
240   }
241
242   private java.lang.Object __equalsCalc = null;
243
244   public synchronized boolean equals(java.lang.Object obj)
245   {
246     if (!(obj instanceof CrossReference))
247       return false;
248     CrossReference other = (CrossReference) obj;
249     if (obj == null)
250       return false;
251     if (this == obj)
252       return true;
253     if (__equalsCalc != null)
254     {
255       return (__equalsCalc == obj);
256     }
257     __equalsCalc = obj;
258     boolean _equals;
259     _equals = true
260             && ((this.accession == null && other.getAccession() == null) || (this.accession != null && this.accession
261                     .equals(other.getAccession())))
262             && ((this.accessionVersion == null && other
263                     .getAccessionVersion() == null) || (this.accessionVersion != null && this.accessionVersion
264                     .equals(other.getAccessionVersion())))
265             && ((this.databaseDescription == null && other
266                     .getDatabaseDescription() == null) || (this.databaseDescription != null && this.databaseDescription
267                     .equals(other.getDatabaseDescription())))
268             && ((this.databaseName == null && other.getDatabaseName() == null) || (this.databaseName != null && this.databaseName
269                     .equals(other.getDatabaseName())))
270             && ((this.dateAdded == null && other.getDateAdded() == null) || (this.dateAdded != null && this.dateAdded
271                     .equals(other.getDateAdded())))
272             && ((this.dateDeleted == null && other.getDateDeleted() == null) || (this.dateDeleted != null && this.dateDeleted
273                     .equals(other.getDateDeleted())))
274             && this.deleted == other.isDeleted()
275             && ((this.gi == null && other.getGi() == null) || (this.gi != null && this.gi
276                     .equals(other.getGi())))
277             && ((this.taxonId == null && other.getTaxonId() == null) || (this.taxonId != null && this.taxonId
278                     .equals(other.getTaxonId())));
279     __equalsCalc = null;
280     return _equals;
281   }
282
283   private boolean __hashCodeCalc = false;
284
285   public synchronized int hashCode()
286   {
287     if (__hashCodeCalc)
288     {
289       return 0;
290     }
291     __hashCodeCalc = true;
292     int _hashCode = 1;
293     if (getAccession() != null)
294     {
295       _hashCode += getAccession().hashCode();
296     }
297     if (getAccessionVersion() != null)
298     {
299       _hashCode += getAccessionVersion().hashCode();
300     }
301     if (getDatabaseDescription() != null)
302     {
303       _hashCode += getDatabaseDescription().hashCode();
304     }
305     if (getDatabaseName() != null)
306     {
307       _hashCode += getDatabaseName().hashCode();
308     }
309     if (getDateAdded() != null)
310     {
311       _hashCode += getDateAdded().hashCode();
312     }
313     if (getDateDeleted() != null)
314     {
315       _hashCode += getDateDeleted().hashCode();
316     }
317     _hashCode += (isDeleted() ? Boolean.TRUE : Boolean.FALSE).hashCode();
318     if (getGi() != null)
319     {
320       _hashCode += getGi().hashCode();
321     }
322     if (getTaxonId() != null)
323     {
324       _hashCode += getTaxonId().hashCode();
325     }
326     __hashCodeCalc = false;
327     return _hashCode;
328   }
329
330 }