7c09741d3183b696fb98e4d0d4a3da97321b271c
[jalview.git] / src / vamsas / objects / simple / Result.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3  * Copyright (C) 2014 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 vamsas.objects.simple;
22
23 public class Result implements java.io.Serializable
24 {
25   private boolean broken;
26
27   private boolean failed;
28
29   private boolean finished;
30
31   private boolean invalid;
32
33   private boolean jobFailed;
34
35   private boolean queued;
36
37   private boolean running;
38
39   private boolean serverError;
40
41   private int state;
42
43   private java.lang.String status;
44
45   private boolean suspended;
46
47   public Result()
48   {
49   }
50
51   public Result(boolean broken, boolean failed, boolean finished,
52           boolean invalid, boolean jobFailed, boolean queued,
53           boolean running, boolean serverError, int state,
54           java.lang.String status, boolean suspended)
55   {
56     this.broken = broken;
57     this.failed = failed;
58     this.finished = finished;
59     this.invalid = invalid;
60     this.jobFailed = jobFailed;
61     this.queued = queued;
62     this.running = running;
63     this.serverError = serverError;
64     this.state = state;
65     this.status = status;
66     this.suspended = suspended;
67   }
68
69   /**
70    * Gets the broken value for this Result.
71    * 
72    * @return broken
73    */
74   public boolean isBroken()
75   {
76     return broken;
77   }
78
79   /**
80    * Sets the broken value for this Result.
81    * 
82    * @param broken
83    */
84   public void setBroken(boolean broken)
85   {
86     this.broken = broken;
87   }
88
89   /**
90    * Gets the failed value for this Result.
91    * 
92    * @return failed
93    */
94   public boolean isFailed()
95   {
96     return failed;
97   }
98
99   /**
100    * Sets the failed value for this Result.
101    * 
102    * @param failed
103    */
104   public void setFailed(boolean failed)
105   {
106     this.failed = failed;
107   }
108
109   /**
110    * Gets the finished value for this Result.
111    * 
112    * @return finished
113    */
114   public boolean isFinished()
115   {
116     return finished;
117   }
118
119   /**
120    * Sets the finished value for this Result.
121    * 
122    * @param finished
123    */
124   public void setFinished(boolean finished)
125   {
126     this.finished = finished;
127   }
128
129   /**
130    * Gets the invalid value for this Result.
131    * 
132    * @return invalid
133    */
134   public boolean isInvalid()
135   {
136     return invalid;
137   }
138
139   /**
140    * Sets the invalid value for this Result.
141    * 
142    * @param invalid
143    */
144   public void setInvalid(boolean invalid)
145   {
146     this.invalid = invalid;
147   }
148
149   /**
150    * Gets the jobFailed value for this Result.
151    * 
152    * @return jobFailed
153    */
154   public boolean isJobFailed()
155   {
156     return jobFailed;
157   }
158
159   /**
160    * Sets the jobFailed value for this Result.
161    * 
162    * @param jobFailed
163    */
164   public void setJobFailed(boolean jobFailed)
165   {
166     this.jobFailed = jobFailed;
167   }
168
169   /**
170    * Gets the queued value for this Result.
171    * 
172    * @return queued
173    */
174   public boolean isQueued()
175   {
176     return queued;
177   }
178
179   /**
180    * Sets the queued value for this Result.
181    * 
182    * @param queued
183    */
184   public void setQueued(boolean queued)
185   {
186     this.queued = queued;
187   }
188
189   /**
190    * Gets the running value for this Result.
191    * 
192    * @return running
193    */
194   public boolean isRunning()
195   {
196     return running;
197   }
198
199   /**
200    * Sets the running value for this Result.
201    * 
202    * @param running
203    */
204   public void setRunning(boolean running)
205   {
206     this.running = running;
207   }
208
209   /**
210    * Gets the serverError value for this Result.
211    * 
212    * @return serverError
213    */
214   public boolean isServerError()
215   {
216     return serverError;
217   }
218
219   /**
220    * Sets the serverError value for this Result.
221    * 
222    * @param serverError
223    */
224   public void setServerError(boolean serverError)
225   {
226     this.serverError = serverError;
227   }
228
229   /**
230    * Gets the state value for this Result.
231    * 
232    * @return state
233    */
234   public int getState()
235   {
236     return state;
237   }
238
239   /**
240    * Sets the state value for this Result.
241    * 
242    * @param state
243    */
244   public void setState(int state)
245   {
246     this.state = state;
247   }
248
249   /**
250    * Gets the status value for this Result.
251    * 
252    * @return status
253    */
254   public java.lang.String getStatus()
255   {
256     return status;
257   }
258
259   /**
260    * Sets the status value for this Result.
261    * 
262    * @param status
263    */
264   public void setStatus(java.lang.String status)
265   {
266     this.status = status;
267   }
268
269   /**
270    * Gets the suspended value for this Result.
271    * 
272    * @return suspended
273    */
274   public boolean isSuspended()
275   {
276     return suspended;
277   }
278
279   /**
280    * Sets the suspended value for this Result.
281    * 
282    * @param suspended
283    */
284   public void setSuspended(boolean suspended)
285   {
286     this.suspended = suspended;
287   }
288
289   private java.lang.Object __equalsCalc = null;
290
291   public synchronized boolean equals(java.lang.Object obj)
292   {
293     if (!(obj instanceof Result))
294       return false;
295     Result other = (Result) obj;
296     if (obj == null)
297       return false;
298     if (this == obj)
299       return true;
300     if (__equalsCalc != null)
301     {
302       return (__equalsCalc == obj);
303     }
304     __equalsCalc = obj;
305     boolean _equals;
306     _equals = true
307             && this.broken == other.isBroken()
308             && this.failed == other.isFailed()
309             && this.finished == other.isFinished()
310             && this.invalid == other.isInvalid()
311             && this.jobFailed == other.isJobFailed()
312             && this.queued == other.isQueued()
313             && this.running == other.isRunning()
314             && this.serverError == other.isServerError()
315             && this.state == other.getState()
316             && ((this.status == null && other.getStatus() == null) || (this.status != null && this.status
317                     .equals(other.getStatus())))
318             && this.suspended == other.isSuspended();
319     __equalsCalc = null;
320     return _equals;
321   }
322
323   private boolean __hashCodeCalc = false;
324
325   public synchronized int hashCode()
326   {
327     if (__hashCodeCalc)
328     {
329       return 0;
330     }
331     __hashCodeCalc = true;
332     int _hashCode = 1;
333     _hashCode += (isBroken() ? Boolean.TRUE : Boolean.FALSE).hashCode();
334     _hashCode += (isFailed() ? Boolean.TRUE : Boolean.FALSE).hashCode();
335     _hashCode += (isFinished() ? Boolean.TRUE : Boolean.FALSE).hashCode();
336     _hashCode += (isInvalid() ? Boolean.TRUE : Boolean.FALSE).hashCode();
337     _hashCode += (isJobFailed() ? Boolean.TRUE : Boolean.FALSE).hashCode();
338     _hashCode += (isQueued() ? Boolean.TRUE : Boolean.FALSE).hashCode();
339     _hashCode += (isRunning() ? Boolean.TRUE : Boolean.FALSE).hashCode();
340     _hashCode += (isServerError() ? Boolean.TRUE : Boolean.FALSE)
341             .hashCode();
342     _hashCode += getState();
343     if (getStatus() != null)
344     {
345       _hashCode += getStatus().hashCode();
346     }
347     _hashCode += (isSuspended() ? Boolean.TRUE : Boolean.FALSE).hashCode();
348     __hashCodeCalc = false;
349     return _hashCode;
350   }
351
352 }