| 1 |
/* |
| 2 |
* Jalview - A Sequence Alignment Editor and Viewer (2.11.5.0) |
| 3 |
* Copyright (C) 2025 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 |
@Override |
| 292 |
public synchronized boolean equals(java.lang.Object obj) |
| 293 |
{ |
| 294 |
if (obj == null) |
| 295 |
{ |
| 296 |
return false; |
| 297 |
} |
| 298 |
if (!(obj instanceof Result)) |
| 299 |
{ |
| 300 |
return false; |
| 301 |
} |
| 302 |
Result other = (Result) obj; |
| 303 |
if (this == obj) |
| 304 |
{ |
| 305 |
return true; |
| 306 |
} |
| 307 |
if (__equalsCalc != null) |
| 308 |
{ |
| 309 |
return (__equalsCalc == obj); |
| 310 |
} |
| 311 |
__equalsCalc = obj; |
| 312 |
boolean _equals; |
| 313 |
_equals = true && this.broken == other.isBroken() |
| 314 |
&& this.failed == other.isFailed() |
| 315 |
&& this.finished == other.isFinished() |
| 316 |
&& this.invalid == other.isInvalid() |
| 317 |
&& this.jobFailed == other.isJobFailed() |
| 318 |
&& this.queued == other.isQueued() |
| 319 |
&& this.running == other.isRunning() |
| 320 |
&& this.serverError == other.isServerError() |
| 321 |
&& this.state == other.getState() |
| 322 |
&& ((this.status == null && other.getStatus() == null) |
| 323 |
|| (this.status != null |
| 324 |
&& this.status.equals(other.getStatus()))) |
| 325 |
&& this.suspended == other.isSuspended(); |
| 326 |
__equalsCalc = null; |
| 327 |
return _equals; |
| 328 |
} |
| 329 |
|
| 330 |
private boolean __hashCodeCalc = false; |
| 331 |
|
| 332 |
@Override |
| 333 |
public synchronized int hashCode() |
| 334 |
{ |
| 335 |
if (__hashCodeCalc) |
| 336 |
{ |
| 337 |
return 0; |
| 338 |
} |
| 339 |
__hashCodeCalc = true; |
| 340 |
int _hashCode = 1; |
| 341 |
_hashCode += (isBroken() ? Boolean.TRUE : Boolean.FALSE).hashCode(); |
| 342 |
_hashCode += (isFailed() ? Boolean.TRUE : Boolean.FALSE).hashCode(); |
| 343 |
_hashCode += (isFinished() ? Boolean.TRUE : Boolean.FALSE).hashCode(); |
| 344 |
_hashCode += (isInvalid() ? Boolean.TRUE : Boolean.FALSE).hashCode(); |
| 345 |
_hashCode += (isJobFailed() ? Boolean.TRUE : Boolean.FALSE).hashCode(); |
| 346 |
_hashCode += (isQueued() ? Boolean.TRUE : Boolean.FALSE).hashCode(); |
| 347 |
_hashCode += (isRunning() ? Boolean.TRUE : Boolean.FALSE).hashCode(); |
| 348 |
_hashCode += (isServerError() ? Boolean.TRUE : Boolean.FALSE) |
| 349 |
.hashCode(); |
| 350 |
_hashCode += getState(); |
| 351 |
if (getStatus() != null) |
| 352 |
{ |
| 353 |
_hashCode += getStatus().hashCode(); |
| 354 |
} |
| 355 |
_hashCode += (isSuspended() ? Boolean.TRUE : Boolean.FALSE).hashCode(); |
| 356 |
__hashCodeCalc = false; |
| 357 |
return _hashCode; |
| 358 |
} |
| 359 |
|
| 360 |
} |