JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / src / uk / ac / ebi / picr / model / UPEntry.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 UPEntry implements java.io.Serializable
24 {
25   private java.lang.String CRC64;
26
27   private java.lang.String UPI;
28
29   private uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences;
30
31   private uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences;
32
33   private java.lang.String sequence;
34
35   private java.util.Calendar timestamp;
36
37   public UPEntry()
38   {
39   }
40
41   public UPEntry(java.lang.String CRC64, java.lang.String UPI,
42           uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences,
43           uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences,
44           java.lang.String sequence, java.util.Calendar timestamp)
45   {
46     this.CRC64 = CRC64;
47     this.UPI = UPI;
48     this.identicalCrossReferences = identicalCrossReferences;
49     this.logicalCrossReferences = logicalCrossReferences;
50     this.sequence = sequence;
51     this.timestamp = timestamp;
52   }
53
54   /**
55    * Gets the CRC64 value for this UPEntry.
56    * 
57    * @return CRC64
58    */
59   public java.lang.String getCRC64()
60   {
61     return CRC64;
62   }
63
64   /**
65    * Sets the CRC64 value for this UPEntry.
66    * 
67    * @param CRC64
68    */
69   public void setCRC64(java.lang.String CRC64)
70   {
71     this.CRC64 = CRC64;
72   }
73
74   /**
75    * Gets the UPI value for this UPEntry.
76    * 
77    * @return UPI
78    */
79   public java.lang.String getUPI()
80   {
81     return UPI;
82   }
83
84   /**
85    * Sets the UPI value for this UPEntry.
86    * 
87    * @param UPI
88    */
89   public void setUPI(java.lang.String UPI)
90   {
91     this.UPI = UPI;
92   }
93
94   /**
95    * Gets the identicalCrossReferences value for this UPEntry.
96    * 
97    * @return identicalCrossReferences
98    */
99   public uk.ac.ebi.picr.model.CrossReference[] getIdenticalCrossReferences()
100   {
101     return identicalCrossReferences;
102   }
103
104   /**
105    * Sets the identicalCrossReferences value for this UPEntry.
106    * 
107    * @param identicalCrossReferences
108    */
109   public void setIdenticalCrossReferences(
110           uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences)
111   {
112     this.identicalCrossReferences = identicalCrossReferences;
113   }
114
115   public uk.ac.ebi.picr.model.CrossReference getIdenticalCrossReferences(
116           int i)
117   {
118     return this.identicalCrossReferences[i];
119   }
120
121   public void setIdenticalCrossReferences(int i,
122           uk.ac.ebi.picr.model.CrossReference _value)
123   {
124     this.identicalCrossReferences[i] = _value;
125   }
126
127   /**
128    * Gets the logicalCrossReferences value for this UPEntry.
129    * 
130    * @return logicalCrossReferences
131    */
132   public uk.ac.ebi.picr.model.CrossReference[] getLogicalCrossReferences()
133   {
134     return logicalCrossReferences;
135   }
136
137   /**
138    * Sets the logicalCrossReferences value for this UPEntry.
139    * 
140    * @param logicalCrossReferences
141    */
142   public void setLogicalCrossReferences(
143           uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences)
144   {
145     this.logicalCrossReferences = logicalCrossReferences;
146   }
147
148   public uk.ac.ebi.picr.model.CrossReference getLogicalCrossReferences(int i)
149   {
150     return this.logicalCrossReferences[i];
151   }
152
153   public void setLogicalCrossReferences(int i,
154           uk.ac.ebi.picr.model.CrossReference _value)
155   {
156     this.logicalCrossReferences[i] = _value;
157   }
158
159   /**
160    * Gets the sequence value for this UPEntry.
161    * 
162    * @return sequence
163    */
164   public java.lang.String getSequence()
165   {
166     return sequence;
167   }
168
169   /**
170    * Sets the sequence value for this UPEntry.
171    * 
172    * @param sequence
173    */
174   public void setSequence(java.lang.String sequence)
175   {
176     this.sequence = sequence;
177   }
178
179   /**
180    * Gets the timestamp value for this UPEntry.
181    * 
182    * @return timestamp
183    */
184   public java.util.Calendar getTimestamp()
185   {
186     return timestamp;
187   }
188
189   /**
190    * Sets the timestamp value for this UPEntry.
191    * 
192    * @param timestamp
193    */
194   public void setTimestamp(java.util.Calendar timestamp)
195   {
196     this.timestamp = timestamp;
197   }
198
199   private java.lang.Object __equalsCalc = null;
200
201   @Override
202   public synchronized boolean equals(java.lang.Object obj)
203   {
204     if (obj == null)
205     {
206       return false;
207     }
208     if (!(obj instanceof UPEntry))
209     {
210       return false;
211     }
212     UPEntry other = (UPEntry) obj;
213     if (this == obj)
214     {
215       return true;
216     }
217     if (__equalsCalc != null)
218     {
219       return (__equalsCalc == obj);
220     }
221     __equalsCalc = obj;
222     boolean _equals;
223     _equals = true
224             && ((this.CRC64 == null && other.getCRC64() == null) || (this.CRC64 != null && this.CRC64
225                     .equals(other.getCRC64())))
226             && ((this.UPI == null && other.getUPI() == null) || (this.UPI != null && this.UPI
227                     .equals(other.getUPI())))
228             && ((this.identicalCrossReferences == null && other
229                     .getIdenticalCrossReferences() == null) || (this.identicalCrossReferences != null && java.util.Arrays
230                     .equals(this.identicalCrossReferences,
231                             other.getIdenticalCrossReferences())))
232             && ((this.logicalCrossReferences == null && other
233                     .getLogicalCrossReferences() == null) || (this.logicalCrossReferences != null && java.util.Arrays
234                     .equals(this.logicalCrossReferences,
235                             other.getLogicalCrossReferences())))
236             && ((this.sequence == null && other.getSequence() == null) || (this.sequence != null && this.sequence
237                     .equals(other.getSequence())))
238             && ((this.timestamp == null && other.getTimestamp() == null) || (this.timestamp != null && this.timestamp
239                     .equals(other.getTimestamp())));
240     __equalsCalc = null;
241     return _equals;
242   }
243
244   private boolean __hashCodeCalc = false;
245
246   @Override
247   public synchronized int hashCode()
248   {
249     if (__hashCodeCalc)
250     {
251       return 0;
252     }
253     __hashCodeCalc = true;
254     int _hashCode = 1;
255     if (getCRC64() != null)
256     {
257       _hashCode += getCRC64().hashCode();
258     }
259     if (getUPI() != null)
260     {
261       _hashCode += getUPI().hashCode();
262     }
263     if (getIdenticalCrossReferences() != null)
264     {
265       for (int i = 0; i < java.lang.reflect.Array
266               .getLength(getIdenticalCrossReferences()); i++)
267       {
268         java.lang.Object obj = java.lang.reflect.Array.get(
269                 getIdenticalCrossReferences(), i);
270         if (obj != null && !obj.getClass().isArray())
271         {
272           _hashCode += obj.hashCode();
273         }
274       }
275     }
276     if (getLogicalCrossReferences() != null)
277     {
278       for (int i = 0; i < java.lang.reflect.Array
279               .getLength(getLogicalCrossReferences()); i++)
280       {
281         java.lang.Object obj = java.lang.reflect.Array.get(
282                 getLogicalCrossReferences(), i);
283         if (obj != null && !obj.getClass().isArray())
284         {
285           _hashCode += obj.hashCode();
286         }
287       }
288     }
289     if (getSequence() != null)
290     {
291       _hashCode += getSequence().hashCode();
292     }
293     if (getTimestamp() != null)
294     {
295       _hashCode += getTimestamp().hashCode();
296     }
297     __hashCodeCalc = false;
298     return _hashCode;
299   }
300
301 }