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