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