001/* 002 * mzTab-M reference implementation and validation API. 003 * This is the mzTab-M reference implementation and validation API service. 004 * 005 * OpenAPI spec version: 2.0.0 006 * Contact: nils.hoffmann@isas.de 007 * 008 * NOTE: This class is auto generated by the swagger code generator program. 009 * https://github.com/swagger-api/swagger-codegen.git 010 * Do not edit the class manually. 011 */ 012 013 014package de.isas.mztab2.model; 015 016import java.util.Objects; 017import java.util.Arrays; 018import com.fasterxml.jackson.annotation.JsonProperty; 019import com.fasterxml.jackson.annotation.JsonCreator; 020import com.fasterxml.jackson.annotation.JsonValue; 021import de.isas.mztab2.model.IndexedElement; 022import de.isas.mztab2.model.Instrument; 023import de.isas.mztab2.model.Parameter; 024import io.swagger.annotations.ApiModel; 025import io.swagger.annotations.ApiModelProperty; 026import java.util.ArrayList; 027import java.util.List; 028import com.fasterxml.jackson.dataformat.xml.annotation.*; 029import javax.xml.bind.annotation.*; 030import javax.validation.constraints.*; 031import javax.validation.Valid; 032import de.isas.lipidomics.mztab2.validation.constraints.*; 033/** 034 * 035 * Specification of ms_run. 036location: Location of the external data file e.g. raw files on which analysis has been performed. If the actual location of the MS run is unknown, a “null” MUST be used as a place holder value, since the [1-n] cardinality is referenced elsewhere. If pre-fractionation has been performed, then [1-n] ms_runs SHOULD be created per assay. 037instrument_ref: If different instruments are used in different runs, instrument_ref can be used to link a specific instrument to a specific run. 038format: Parameter specifying the data format of the external MS data file. If ms_run[1-n]-format is present, ms_run[1-n]-id_format SHOULD also be present, following the parameters specified in Table 1. 039id_format: Parameter specifying the id format used in the external data file. If ms_run[1-n]-id_format is present, ms_run[1-n]-format SHOULD also be present. 040fragmentation_method: The type(s) of fragmentation used in a given ms run. 041scan_polarity: The polarity mode of a given run. Usually only one value SHOULD be given here except for the case of mixed polarity runs. 042hash: Hash value of the corresponding external MS data file defined in ms_run[1-n]-location. If ms_run[1-n]-hash is present, ms_run[1-n]-hash_method SHOULD also be present. 043hash_method: A parameter specifying the hash methods used to generate the String in ms_run[1-n]-hash. Specifics of the hash method used MAY follow the definitions of the mzML format. If ms_run[1-n]-hash is present, ms_run[1-n]-hash_method SHOULD also be present. 044 045 * 046 * 047 * <p>mzTab-M specification example(s):</p> 048 * <pre><code>COM location can be a local or remote URI 049MTD ms_run[1]-location file:///C:/path/to/my/file.mzML 050MTD ms_run[1]-instrument_ref instrument[1] 051MTD ms_run[1]-format [MS, MS:1000584, mzML file, ] 052MTD ms_run[1]-id_format [MS, MS:1000530, mzML unique identifier, ] 053MTD ms_run[1]-fragmentation_method[1] [MS, MS:1000133, CID, ] 054COM for mixed polarity scan scenarios 055MTD ms_run[1]-scan_polarity[1] [MS, MS:1000130, positive scan, ] 056MTD ms_run[1]-scan_polarity[2] [MS, MS:1000129, negative scan, ] 057MTD ms_run[1]-hash_method [MS, MS:1000569, SHA-1, ] 058MTD ms_run[1]-hash de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3 059</code></pre> 060 * 061 * 062 */ 063@ApiModel(description = "Specification of ms_run. location: Location of the external data file e.g. raw files on which analysis has been performed. If the actual location of the MS run is unknown, a “null” MUST be used as a place holder value, since the [1-n] cardinality is referenced elsewhere. If pre-fractionation has been performed, then [1-n] ms_runs SHOULD be created per assay. instrument_ref: If different instruments are used in different runs, instrument_ref can be used to link a specific instrument to a specific run. format: Parameter specifying the data format of the external MS data file. If ms_run[1-n]-format is present, ms_run[1-n]-id_format SHOULD also be present, following the parameters specified in Table 1. id_format: Parameter specifying the id format used in the external data file. If ms_run[1-n]-id_format is present, ms_run[1-n]-format SHOULD also be present. fragmentation_method: The type(s) of fragmentation used in a given ms run. scan_polarity: The polarity mode of a given run. Usually only one value SHOULD be given here except for the case of mixed polarity runs. hash: Hash value of the corresponding external MS data file defined in ms_run[1-n]-location. If ms_run[1-n]-hash is present, ms_run[1-n]-hash_method SHOULD also be present. hash_method: A parameter specifying the hash methods used to generate the String in ms_run[1-n]-hash. Specifics of the hash method used MAY follow the definitions of the mzML format. If ms_run[1-n]-hash is present, ms_run[1-n]-hash_method SHOULD also be present. ") 064@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-08-07T11:09:24.487+02:00") 065@XmlRootElement(name = "MsRun") 066@XmlAccessorType(XmlAccessType.FIELD) 067@JacksonXmlRootElement(localName = "MsRun") 068public class MsRun extends IndexedElement { 069 070 /** 071 * Property enumeration for MsRun. 072 */ 073 public static enum Properties { 074 name("name"), 075 location("location"), 076 instrumentRef("instrument_ref"), 077 format("format"), 078 idFormat("id_format"), 079 fragmentationMethod("fragmentation_method"), 080 scanPolarity("scan_polarity"), 081 hash("hash"), 082 hashMethod("hash_method"); 083 084 private final String propertyName; 085 086 private Properties(String propertyName) { 087 this.propertyName = propertyName; 088 } 089 090 public String getPropertyName() { 091 return propertyName; 092 } 093 094 public String toString() { 095 return propertyName; 096 } 097 098 public String toUpper() { 099 return propertyName.toUpperCase(); 100 } 101 102 public static Properties of(String value) { 103 if(value==null) { 104 throw new NullPointerException("Argument value must not be null!"); 105 } 106 return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new); 107 } 108 }; 109 110 @JsonProperty("name") 111 @JacksonXmlProperty(localName = "name") 112 @XmlElement(name = "name") 113 private String name = null; 114 @JsonProperty("location") 115 @JacksonXmlProperty(localName = "location") 116 @XmlElement(name = "location") 117 private String location = null; 118 @JsonProperty("instrument_ref") 119 @JacksonXmlProperty(localName = "instrument_ref") 120 @XmlElement(name = "instrument_ref") 121 private Instrument instrumentRef = null; 122 @JsonProperty("format") 123 @JacksonXmlProperty(localName = "format") 124 @XmlElement(name = "format") 125 private Parameter format = null; 126 @JsonProperty("id_format") 127 @JacksonXmlProperty(localName = "id_format") 128 @XmlElement(name = "id_format") 129 private Parameter idFormat = null; 130 @JsonProperty("fragmentation_method") 131 // Is a container wrapped=false 132 // items.name=fragmentationMethod items.baseName=fragmentationMethod items.xmlName= items.xmlNamespace= 133 // items.example= items.type=Parameter 134 @XmlElement(name = "fragmentationMethod") 135 private List<Parameter> fragmentationMethod = null; 136 @JsonProperty("scan_polarity") 137 // Is a container wrapped=false 138 // items.name=scanPolarity items.baseName=scanPolarity items.xmlName= items.xmlNamespace= 139 // items.example= items.type=Parameter 140 @XmlElement(name = "scanPolarity") 141 private List<Parameter> scanPolarity = null; 142 @JsonProperty("hash") 143 @JacksonXmlProperty(localName = "hash") 144 @XmlElement(name = "hash") 145 private String hash = null; 146 @JsonProperty("hash_method") 147 @JacksonXmlProperty(localName = "hash_method") 148 @XmlElement(name = "hash_method") 149 private Parameter hashMethod = null; 150 151 @Override 152 public MsRun id(Integer id) { 153 super.setId(id); 154 return this; 155 } 156 157 @Override 158 public MsRun elementType(String elementType) { 159 super.setElementType(elementType); 160 return this; 161 } 162 163 /** 164 * Builder method for name. 165 * 166 * @see MsRun#setName MsRun#setName for specification examples 167 * @see MsRun#getName MsRun#getName for validation constraints 168 * @param name a {@code String} parameter. 169 * @return MsRun 170 **/ 171 public MsRun name(String name) { 172 this.name = name; 173 return this; 174 } 175 176 /** 177 * The msRun's name. 178 * 179 * @return name 180 **/ 181 @NotNull 182 @ApiModelProperty(required = true, value = "The msRun's name.") 183 public String getName() { 184 return name; 185 } 186 187 /** 188 * Set name. 189 * 190 * 191 * 192 * @see #getName MsRun#getName for validation constraints 193 * @param name a {@code String} parameter. 194 **/ 195 public void setName(String name) { 196 this.name = name; 197 } 198 199 200 /** 201 * Builder method for location. 202 * 203 * @see MsRun#setLocation MsRun#setLocation for specification examples 204 * @see MsRun#getLocation MsRun#getLocation for validation constraints 205 * @param location a {@code String} parameter. 206 * @return MsRun 207 **/ 208 public MsRun location(String location) { 209 this.location = location; 210 return this; 211 } 212 213 /** 214 * The msRun's location URI. 215 * 216 * @return location 217 **/ 218 @NotNull 219 @ApiModelProperty(required = true, value = "The msRun's location URI.") 220 public String getLocation() { 221 return location; 222 } 223 224 /** 225 * Set location. 226 * 227 * 228 * 229 * @see #getLocation MsRun#getLocation for validation constraints 230 * @param location a {@code String} parameter. 231 **/ 232 public void setLocation(String location) { 233 this.location = location; 234 } 235 236 237 /** 238 * Builder method for instrumentRef. 239 * 240 * @see MsRun#setInstrumentRef MsRun#setInstrumentRef for specification examples 241 * @see MsRun#getInstrumentRef MsRun#getInstrumentRef for validation constraints 242 * @param instrumentRef a {@code Instrument} parameter. 243 * @return MsRun 244 **/ 245 public MsRun instrumentRef(Instrument instrumentRef) { 246 this.instrumentRef = instrumentRef; 247 return this; 248 } 249 250 /** 251 * The instrument on which this msRun was measured. 252 * 253 * @return instrumentRef 254 **/ 255 @Valid 256 @ApiModelProperty(value = "The instrument on which this msRun was measured.") 257 public Instrument getInstrumentRef() { 258 return instrumentRef; 259 } 260 261 /** 262 * Set instrumentRef. 263 * 264 * 265 * 266 * @see #getInstrumentRef MsRun#getInstrumentRef for validation constraints 267 * @param instrumentRef a {@code Instrument} parameter. 268 **/ 269 public void setInstrumentRef(Instrument instrumentRef) { 270 this.instrumentRef = instrumentRef; 271 } 272 273 274 /** 275 * Builder method for format. 276 * 277 * @see MsRun#setFormat MsRun#setFormat for specification examples 278 * @see MsRun#getFormat MsRun#getFormat for validation constraints 279 * @param format a {@code Parameter} parameter. 280 * @return MsRun 281 **/ 282 public MsRun format(Parameter format) { 283 this.format = format; 284 return this; 285 } 286 287 /** 288 * The msRun's file format. 289 * 290 * @return format 291 **/ 292 @Valid 293 @ApiModelProperty(value = "The msRun's file format.") 294 public Parameter getFormat() { 295 return format; 296 } 297 298 /** 299 * Set format. 300 * 301 * 302 * 303 * @see #getFormat MsRun#getFormat for validation constraints 304 * @param format a {@code Parameter} parameter. 305 **/ 306 public void setFormat(Parameter format) { 307 this.format = format; 308 } 309 310 311 /** 312 * Builder method for idFormat. 313 * 314 * @see MsRun#setIdFormat MsRun#setIdFormat for specification examples 315 * @see MsRun#getIdFormat MsRun#getIdFormat for validation constraints 316 * @param idFormat a {@code Parameter} parameter. 317 * @return MsRun 318 **/ 319 public MsRun idFormat(Parameter idFormat) { 320 this.idFormat = idFormat; 321 return this; 322 } 323 324 /** 325 * The msRun's mass spectra id format. 326 * 327 * @return idFormat 328 **/ 329 @Valid 330 @ApiModelProperty(value = "The msRun's mass spectra id format.") 331 public Parameter getIdFormat() { 332 return idFormat; 333 } 334 335 /** 336 * Set idFormat. 337 * 338 * 339 * 340 * @see #getIdFormat MsRun#getIdFormat for validation constraints 341 * @param idFormat a {@code Parameter} parameter. 342 **/ 343 public void setIdFormat(Parameter idFormat) { 344 this.idFormat = idFormat; 345 } 346 347 348 /** 349 * Builder method for fragmentationMethod. 350 * 351 * @see MsRun#setFragmentationMethod MsRun#setFragmentationMethod for specification examples 352 * @see MsRun#getFragmentationMethod MsRun#getFragmentationMethod for validation constraints 353 * @param fragmentationMethod a {@code List<Parameter>} parameter. 354 * @return MsRun 355 **/ 356 public MsRun fragmentationMethod(List<Parameter> fragmentationMethod) { 357 this.fragmentationMethod = fragmentationMethod; 358 return this; 359 } 360 361 /** 362 * Add a single fragmentationMethodItem to the fragmentationMethod collection. 363 * 364 * @see MsRun#getFragmentationMethod MsRun#getFragmentationMethod for validation constraints 365 * @param fragmentationMethodItem a {@code Parameter} parameter. 366 * @return MsRun 367 */ 368 public MsRun addFragmentationMethodItem(Parameter fragmentationMethodItem) { 369 if (this.fragmentationMethod == null) { 370 this.fragmentationMethod = new ArrayList<>(); 371 } 372 this.fragmentationMethod.add(fragmentationMethodItem); 373 return this; 374 } 375 376 /** 377 * The fragmentation methods applied during this msRun. 378 * 379 * @return fragmentationMethod 380 **/ 381 @Valid 382 @ApiModelProperty(value = "The fragmentation methods applied during this msRun.") 383 public List<Parameter> getFragmentationMethod() { 384 return fragmentationMethod; 385 } 386 387 /** 388 * Set fragmentationMethod. 389 * 390 * 391 * 392 * @see #getFragmentationMethod MsRun#getFragmentationMethod for validation constraints 393 * @param fragmentationMethod a {@code List<Parameter>} parameter. 394 **/ 395 public void setFragmentationMethod(List<Parameter> fragmentationMethod) { 396 this.fragmentationMethod = fragmentationMethod; 397 } 398 399 400 /** 401 * Builder method for scanPolarity. 402 * 403 * @see MsRun#setScanPolarity MsRun#setScanPolarity for specification examples 404 * @see MsRun#getScanPolarity MsRun#getScanPolarity for validation constraints 405 * @param scanPolarity a {@code List<Parameter>} parameter. 406 * @return MsRun 407 **/ 408 public MsRun scanPolarity(List<Parameter> scanPolarity) { 409 this.scanPolarity = scanPolarity; 410 return this; 411 } 412 413 /** 414 * Add a single scanPolarityItem to the scanPolarity collection. 415 * 416 * @see MsRun#getScanPolarity MsRun#getScanPolarity for validation constraints 417 * @param scanPolarityItem a {@code Parameter} parameter. 418 * @return MsRun 419 */ 420 public MsRun addScanPolarityItem(Parameter scanPolarityItem) { 421 if (this.scanPolarity == null) { 422 this.scanPolarity = new ArrayList<>(); 423 } 424 this.scanPolarity.add(scanPolarityItem); 425 return this; 426 } 427 428 /** 429 * The scan polarity/polarities used during this msRun. 430 * 431 * @return scanPolarity 432 **/ 433 @Valid 434 @ApiModelProperty(value = "The scan polarity/polarities used during this msRun.") 435 public List<Parameter> getScanPolarity() { 436 return scanPolarity; 437 } 438 439 /** 440 * Set scanPolarity. 441 * 442 * 443 * 444 * @see #getScanPolarity MsRun#getScanPolarity for validation constraints 445 * @param scanPolarity a {@code List<Parameter>} parameter. 446 **/ 447 public void setScanPolarity(List<Parameter> scanPolarity) { 448 this.scanPolarity = scanPolarity; 449 } 450 451 452 /** 453 * Builder method for hash. 454 * 455 * @see MsRun#setHash MsRun#setHash for specification examples 456 * @see MsRun#getHash MsRun#getHash for validation constraints 457 * @param hash a {@code String} parameter. 458 * @return MsRun 459 **/ 460 public MsRun hash(String hash) { 461 this.hash = hash; 462 return this; 463 } 464 465 /** 466 * The file hash value of this msRun's data file. 467 * 468 * @return hash 469 **/ 470 @ApiModelProperty(value = "The file hash value of this msRun's data file.") 471 public String getHash() { 472 return hash; 473 } 474 475 /** 476 * Set hash. 477 * 478 * 479 * 480 * @see #getHash MsRun#getHash for validation constraints 481 * @param hash a {@code String} parameter. 482 **/ 483 public void setHash(String hash) { 484 this.hash = hash; 485 } 486 487 488 /** 489 * Builder method for hashMethod. 490 * 491 * @see MsRun#setHashMethod MsRun#setHashMethod for specification examples 492 * @see MsRun#getHashMethod MsRun#getHashMethod for validation constraints 493 * @param hashMethod a {@code Parameter} parameter. 494 * @return MsRun 495 **/ 496 public MsRun hashMethod(Parameter hashMethod) { 497 this.hashMethod = hashMethod; 498 return this; 499 } 500 501 /** 502 * The hash method used to calculate the file hash. 503 * 504 * @return hashMethod 505 **/ 506 @Valid 507 @ApiModelProperty(value = "The hash method used to calculate the file hash.") 508 public Parameter getHashMethod() { 509 return hashMethod; 510 } 511 512 /** 513 * Set hashMethod. 514 * 515 * 516 * 517 * @see #getHashMethod MsRun#getHashMethod for validation constraints 518 * @param hashMethod a {@code Parameter} parameter. 519 **/ 520 public void setHashMethod(Parameter hashMethod) { 521 this.hashMethod = hashMethod; 522 } 523 524 525 @Override 526 public boolean equals(java.lang.Object o) { 527 if (this == o) { 528 return true; 529 } 530 if (o == null || getClass() != o.getClass()) { 531 return false; 532 } 533 MsRun msRun = (MsRun) o; 534 return Objects.equals(this.name, msRun.name) && 535 Objects.equals(this.location, msRun.location) && 536 Objects.equals(this.instrumentRef, msRun.instrumentRef) && 537 Objects.equals(this.format, msRun.format) && 538 Objects.equals(this.idFormat, msRun.idFormat) && 539 Objects.equals(this.fragmentationMethod, msRun.fragmentationMethod) && 540 Objects.equals(this.scanPolarity, msRun.scanPolarity) && 541 Objects.equals(this.hash, msRun.hash) && 542 Objects.equals(this.hashMethod, msRun.hashMethod) && 543 super.equals(o); 544 } 545 546 @Override 547 public int hashCode() { 548 return Objects.hash(name, location, instrumentRef, format, idFormat, fragmentationMethod, scanPolarity, hash, hashMethod, super.hashCode()); 549 } 550 551 552 @Override 553 public String toString() { 554 StringBuilder sb = new StringBuilder(); 555 sb.append("class MsRun {\n"); 556 sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 557 sb.append(" name: ").append(toIndentedString(name)).append("\n"); 558 sb.append(" location: ").append(toIndentedString(location)).append("\n"); 559 sb.append(" instrumentRef: ").append(toIndentedString(instrumentRef)).append("\n"); 560 sb.append(" format: ").append(toIndentedString(format)).append("\n"); 561 sb.append(" idFormat: ").append(toIndentedString(idFormat)).append("\n"); 562 sb.append(" fragmentationMethod: ").append(toIndentedString(fragmentationMethod)).append("\n"); 563 sb.append(" scanPolarity: ").append(toIndentedString(scanPolarity)).append("\n"); 564 sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); 565 sb.append(" hashMethod: ").append(toIndentedString(hashMethod)).append("\n"); 566 sb.append("}"); 567 return sb.toString(); 568 } 569 570 /** 571 * Convert the given object to string with each line indented by 4 spaces 572 * (except the first line). 573 */ 574 private String toIndentedString(java.lang.Object o) { 575 if (o == null) { 576 return "null"; 577 } 578 return o.toString().replace("\n", "\n "); 579 } 580 581} 582