JAL-3438 spotless for 2.11.2.0
[jalview.git] / src / uk / ac / ebi / picr / model / UPEntry.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ 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(
149           int i)
150   {
151     return this.logicalCrossReferences[i];
152   }
153
154   public void setLogicalCrossReferences(int i,
155           uk.ac.ebi.picr.model.CrossReference _value)
156   {
157     this.logicalCrossReferences[i] = _value;
158   }
159
160   /**
161    * Gets the sequence value for this UPEntry.
162    * 
163    * @return sequence
164    */
165   public java.lang.String getSequence()
166   {
167     return sequence;
168   }
169
170   /**
171    * Sets the sequence value for this UPEntry.
172    * 
173    * @param sequence
174    */
175   public void setSequence(java.lang.String sequence)
176   {
177     this.sequence = sequence;
178   }
179
180   /**
181    * Gets the timestamp value for this UPEntry.
182    * 
183    * @return timestamp
184    */
185   public java.util.Calendar getTimestamp()
186   {
187     return timestamp;
188   }
189
190   /**
191    * Sets the timestamp value for this UPEntry.
192    * 
193    * @param timestamp
194    */
195   public void setTimestamp(java.util.Calendar timestamp)
196   {
197     this.timestamp = timestamp;
198   }
199
200   private java.lang.Object __equalsCalc = null;
201
202   @Override
203   public synchronized boolean equals(java.lang.Object obj)
204   {
205     if (obj == null)
206     {
207       return false;
208     }
209     if (!(obj instanceof UPEntry))
210     {
211       return false;
212     }
213     UPEntry other = (UPEntry) obj;
214     if (this == obj)
215     {
216       return true;
217     }
218     if (__equalsCalc != null)
219     {
220       return (__equalsCalc == obj);
221     }
222     __equalsCalc = obj;
223     boolean _equals;
224     _equals = true && ((this.CRC64 == null && other.getCRC64() == null)
225             || (this.CRC64 != null && this.CRC64.equals(other.getCRC64())))
226             && ((this.UPI == null && other.getUPI() == null)
227                     || (this.UPI != null
228                             && this.UPI.equals(other.getUPI())))
229             && ((this.identicalCrossReferences == null
230                     && other.getIdenticalCrossReferences() == null)
231                     || (this.identicalCrossReferences != null
232                             && java.util.Arrays.equals(
233                                     this.identicalCrossReferences,
234                                     other.getIdenticalCrossReferences())))
235             && ((this.logicalCrossReferences == null
236                     && other.getLogicalCrossReferences() == null)
237                     || (this.logicalCrossReferences != null
238                             && java.util.Arrays.equals(
239                                     this.logicalCrossReferences,
240                                     other.getLogicalCrossReferences())))
241             && ((this.sequence == null && other.getSequence() == null)
242                     || (this.sequence != null
243                             && this.sequence.equals(other.getSequence())))
244             && ((this.timestamp == null && other.getTimestamp() == null)
245                     || (this.timestamp != null && this.timestamp
246                             .equals(other.getTimestamp())));
247     __equalsCalc = null;
248     return _equals;
249   }
250
251   private boolean __hashCodeCalc = false;
252
253   @Override
254   public synchronized int hashCode()
255   {
256     if (__hashCodeCalc)
257     {
258       return 0;
259     }
260     __hashCodeCalc = true;
261     int _hashCode = 1;
262     if (getCRC64() != null)
263     {
264       _hashCode += getCRC64().hashCode();
265     }
266     if (getUPI() != null)
267     {
268       _hashCode += getUPI().hashCode();
269     }
270     if (getIdenticalCrossReferences() != null)
271     {
272       for (int i = 0; i < java.lang.reflect.Array
273               .getLength(getIdenticalCrossReferences()); i++)
274       {
275         java.lang.Object obj = java.lang.reflect.Array
276                 .get(getIdenticalCrossReferences(), i);
277         if (obj != null && !obj.getClass().isArray())
278         {
279           _hashCode += obj.hashCode();
280         }
281       }
282     }
283     if (getLogicalCrossReferences() != null)
284     {
285       for (int i = 0; i < java.lang.reflect.Array
286               .getLength(getLogicalCrossReferences()); i++)
287       {
288         java.lang.Object obj = java.lang.reflect.Array
289                 .get(getLogicalCrossReferences(), i);
290         if (obj != null && !obj.getClass().isArray())
291         {
292           _hashCode += obj.hashCode();
293         }
294       }
295     }
296     if (getSequence() != null)
297     {
298       _hashCode += getSequence().hashCode();
299     }
300     if (getTimestamp() != null)
301     {
302       _hashCode += getTimestamp().hashCode();
303     }
304     __hashCodeCalc = false;
305     return _hashCode;
306   }
307
308 }