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.Parameter;
022import io.swagger.annotations.ApiModel;
023import io.swagger.annotations.ApiModelProperty;
024import java.util.ArrayList;
025import java.util.List;
026import com.fasterxml.jackson.dataformat.xml.annotation.*;
027import javax.xml.bind.annotation.*;
028import javax.validation.constraints.*;
029import javax.validation.Valid;
030import de.isas.lipidomics.mztab2.validation.constraints.*;
031/**
032 * 
033 * Specification of sample.
034(empty) name: A name for each sample to serve as a list of the samples that MUST be reported in the following tables. Samples MUST be reported if a statistical design is being captured (i.e. bio or tech replicates). If the type of replicates are not known, samples SHOULD NOT be reported. 
035species: The respective species of the samples analysed. For more complex cases, such as metagenomics, optional columns and userParams should be used. 
036tissue: The respective tissue(s) of the sample. 
037cell_type: The respective cell type(s) of the sample. 
038disease: The respective disease(s) of the sample. 
039description: A human readable description of the sample. 
040custom: Custom parameters describing the sample's additional properties. Dates MUST be provided in ISO-8601 format.
041
042 * 
043 *
044 * <p>mzTab-M specification example(s):</p>
045 * <pre><code>COM       Experiment where all samples consisted of the same two species
046MTD     sample[1]       individual number 1
047MTD     sample[1]-species[1]    [NCBITaxon, NCBITaxon:9606, Homo sapiens, ]
048MTD     sample[1]-tissue[1]     [BTO, BTO:0000759, liver, ]
049MTD     sample[1]-cell_type[1]  [CL, CL:0000182, hepatocyte, ]
050MTD     sample[1]-disease[1]    [DOID, DOID:684, hepatocellular carcinoma, ]
051MTD     sample[1]-disease[2]    [DOID, DOID:9451, alcoholic fatty liver, ]
052MTD     sample[1]-description   Hepatocellular carcinoma samples.
053MTD     sample[1]-custom[1]     [,,Extraction date, 2011-12-21]
054MTD     sample[1]-custom[2]     [,,Extraction reason, liver biopsy]
055MTD     sample[2]       individual number 2
056MTD     sample[2]-species[1]    [NCBITaxon, NCBITaxon:9606, Homo sapiens, ]
057MTD     sample[2]-tissue[1]     [BTO, BTO:0000759, liver, ]
058MTD     sample[2]-cell_type[1]  [CL, CL:0000182, hepatocyte, ]
059MTD     sample[2]-description   Healthy control samples.
060</code></pre>
061 * 
062 *
063 */
064@com.fasterxml.jackson.annotation.JsonIdentityInfo(generator = com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator.class, property = "id", scope = Sample.class)
065@ApiModel(description = "Specification of sample. (empty) name: A name for each sample to serve as a list of the samples that MUST be reported in the following tables. Samples MUST be reported if a statistical design is being captured (i.e. bio or tech replicates). If the type of replicates are not known, samples SHOULD NOT be reported.  species: The respective species of the samples analysed. For more complex cases, such as metagenomics, optional columns and userParams should be used.  tissue: The respective tissue(s) of the sample.  cell_type: The respective cell type(s) of the sample.  disease: The respective disease(s) of the sample.  description: A human readable description of the sample.  custom: Custom parameters describing the sample's additional properties. Dates MUST be provided in ISO-8601 format. ")
066@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2021-01-02T19:26:21.550+01:00")
067@XmlRootElement(name = "Sample")
068@XmlAccessorType(XmlAccessType.FIELD)
069@JacksonXmlRootElement(localName = "Sample")
070public class Sample {
071
072  /**
073   * Property enumeration for Sample.
074   */
075  public static enum Properties {
076      id("id"), 
077      name("name"), 
078      custom("custom"), 
079      species("species"), 
080      tissue("tissue"), 
081      cellType("cell_type"), 
082      disease("disease"), 
083      description("description");
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("custom")
120  // Is a container wrapped=false
121  // items.name=custom items.baseName=custom items.xmlName= items.xmlNamespace=
122  // items.example= items.type=Parameter
123  @XmlElement(name = "custom")
124  private List<Parameter> custom = null;
125  @JsonProperty("species")
126  // Is a container wrapped=false
127  // items.name=species items.baseName=species items.xmlName= items.xmlNamespace=
128  // items.example= items.type=Parameter
129  @XmlElement(name = "species")
130  private List<Parameter> species = null;
131  @JsonProperty("tissue")
132  // Is a container wrapped=false
133  // items.name=tissue items.baseName=tissue items.xmlName= items.xmlNamespace=
134  // items.example= items.type=Parameter
135  @XmlElement(name = "tissue")
136  private List<Parameter> tissue = null;
137  @JsonProperty("cell_type")
138  // Is a container wrapped=false
139  // items.name=cellType items.baseName=cellType items.xmlName= items.xmlNamespace=
140  // items.example= items.type=Parameter
141  @XmlElement(name = "cellType")
142  private List<Parameter> cellType = null;
143  @JsonProperty("disease")
144  // Is a container wrapped=false
145  // items.name=disease items.baseName=disease items.xmlName= items.xmlNamespace=
146  // items.example= items.type=Parameter
147  @XmlElement(name = "disease")
148  private List<Parameter> disease = null;
149  @JsonProperty("description")
150  @JacksonXmlProperty(localName = "description")
151  @XmlElement(name = "description")
152  private String description = null;
153
154 /**
155   * Builder method for id.
156   *
157   * @see Sample#setId Sample#setId for specification examples
158   * @see Sample#getId Sample#getId for validation constraints
159   * @param id a {@code Integer} parameter.
160   * @return Sample
161  **/
162  public Sample id(Integer id) {
163   this.id = id;
164   return this;
165  }
166
167   /**
168   * <p>Get id.</p>
169   *
170   * <p>Minimum: 1</p>
171   * @return id
172  **/
173 @Min(1)  @ApiModelProperty(value = "")
174  public Integer getId() {
175    return id;
176  }
177
178 /**
179   * Set id.
180   *
181   * 
182   * 
183   * @see #getId Sample#getId for validation constraints
184   * @param id a {@code Integer} parameter.
185  **/
186  public void setId(Integer id) {
187    this.id = id;
188  }
189
190
191 /**
192   * Builder method for name.
193   *
194   * @see Sample#setName Sample#setName for specification examples
195   * @see Sample#getName Sample#getName for validation constraints
196   * @param name a {@code String} parameter.
197   * @return Sample
198  **/
199  public Sample name(String name) {
200   this.name = name;
201   return this;
202  }
203
204   /**
205   * The sample&#39;s name.
206   *
207   * @return name
208  **/
209  @ApiModelProperty(value = "The sample's name.")
210  public String getName() {
211    return name;
212  }
213
214 /**
215   * Set name.
216   *
217   * 
218   * 
219   * @see #getName Sample#getName for validation constraints
220   * @param name a {@code String} parameter.
221  **/
222  public void setName(String name) {
223    this.name = name;
224  }
225
226
227 /**
228   * Builder method for custom.
229   *
230   * @see Sample#setCustom Sample#setCustom for specification examples
231   * @see Sample#getCustom Sample#getCustom for validation constraints
232   * @param custom a {@code List<Parameter>} parameter.
233   * @return Sample
234  **/
235  public Sample custom(List<Parameter> custom) {
236   this.custom = custom;
237   return this;
238  }
239
240  /**
241   * Add a single customItem to the custom collection.
242   *
243   * @see Sample#getCustom Sample#getCustom for validation constraints
244   * @param customItem a {@code Parameter} parameter.
245   * @return Sample
246   */
247  public Sample addCustomItem(Parameter customItem) {
248    if (this.custom == null) {
249      this.custom = new ArrayList<>();
250    }
251    this.custom.add(customItem);
252    return this;
253  }
254
255   /**
256   * Additional user or cv parameters.
257   *
258   * @return custom
259  **/
260  @Valid
261  @ApiModelProperty(value = "Additional user or cv parameters.")
262  public List<Parameter> getCustom() {
263    return custom;
264  }
265
266 /**
267   * Set custom.
268   *
269   * 
270   * 
271   * @see #getCustom Sample#getCustom for validation constraints
272   * @param custom a {@code List<Parameter>} parameter.
273  **/
274  public void setCustom(List<Parameter> custom) {
275    this.custom = custom;
276  }
277
278
279 /**
280   * Builder method for species.
281   *
282   * @see Sample#setSpecies Sample#setSpecies for specification examples
283   * @see Sample#getSpecies Sample#getSpecies for validation constraints
284   * @param species a {@code List<Parameter>} parameter.
285   * @return Sample
286  **/
287  public Sample species(List<Parameter> species) {
288   this.species = species;
289   return this;
290  }
291
292  /**
293   * Add a single speciesItem to the species collection.
294   *
295   * @see Sample#getSpecies Sample#getSpecies for validation constraints
296   * @param speciesItem a {@code Parameter} parameter.
297   * @return Sample
298   */
299  public Sample addSpeciesItem(Parameter speciesItem) {
300    if (this.species == null) {
301      this.species = new ArrayList<>();
302    }
303    this.species.add(speciesItem);
304    return this;
305  }
306
307   /**
308   * Biological species information on the sample.
309   *
310   * @return species
311  **/
312  @Valid
313  @ApiModelProperty(value = "Biological species information on the sample.")
314  public List<Parameter> getSpecies() {
315    return species;
316  }
317
318 /**
319   * Set species.
320   *
321   * 
322   * 
323   * @see #getSpecies Sample#getSpecies for validation constraints
324   * @param species a {@code List<Parameter>} parameter.
325  **/
326  public void setSpecies(List<Parameter> species) {
327    this.species = species;
328  }
329
330
331 /**
332   * Builder method for tissue.
333   *
334   * @see Sample#setTissue Sample#setTissue for specification examples
335   * @see Sample#getTissue Sample#getTissue for validation constraints
336   * @param tissue a {@code List<Parameter>} parameter.
337   * @return Sample
338  **/
339  public Sample tissue(List<Parameter> tissue) {
340   this.tissue = tissue;
341   return this;
342  }
343
344  /**
345   * Add a single tissueItem to the tissue collection.
346   *
347   * @see Sample#getTissue Sample#getTissue for validation constraints
348   * @param tissueItem a {@code Parameter} parameter.
349   * @return Sample
350   */
351  public Sample addTissueItem(Parameter tissueItem) {
352    if (this.tissue == null) {
353      this.tissue = new ArrayList<>();
354    }
355    this.tissue.add(tissueItem);
356    return this;
357  }
358
359   /**
360   * Biological tissue information on the sample.
361   *
362   * @return tissue
363  **/
364  @Valid
365  @ApiModelProperty(value = "Biological tissue information on the sample.")
366  public List<Parameter> getTissue() {
367    return tissue;
368  }
369
370 /**
371   * Set tissue.
372   *
373   * 
374   * 
375   * @see #getTissue Sample#getTissue for validation constraints
376   * @param tissue a {@code List<Parameter>} parameter.
377  **/
378  public void setTissue(List<Parameter> tissue) {
379    this.tissue = tissue;
380  }
381
382
383 /**
384   * Builder method for cellType.
385   *
386   * @see Sample#setCellType Sample#setCellType for specification examples
387   * @see Sample#getCellType Sample#getCellType for validation constraints
388   * @param cellType a {@code List<Parameter>} parameter.
389   * @return Sample
390  **/
391  public Sample cellType(List<Parameter> cellType) {
392   this.cellType = cellType;
393   return this;
394  }
395
396  /**
397   * Add a single cellTypeItem to the cellType collection.
398   *
399   * @see Sample#getCellType Sample#getCellType for validation constraints
400   * @param cellTypeItem a {@code Parameter} parameter.
401   * @return Sample
402   */
403  public Sample addCellTypeItem(Parameter cellTypeItem) {
404    if (this.cellType == null) {
405      this.cellType = new ArrayList<>();
406    }
407    this.cellType.add(cellTypeItem);
408    return this;
409  }
410
411   /**
412   * Biological cell type information on the sample.
413   *
414   * @return cellType
415  **/
416  @Valid
417  @ApiModelProperty(value = "Biological cell type information on the sample.")
418  public List<Parameter> getCellType() {
419    return cellType;
420  }
421
422 /**
423   * Set cellType.
424   *
425   * 
426   * 
427   * @see #getCellType Sample#getCellType for validation constraints
428   * @param cellType a {@code List<Parameter>} parameter.
429  **/
430  public void setCellType(List<Parameter> cellType) {
431    this.cellType = cellType;
432  }
433
434
435 /**
436   * Builder method for disease.
437   *
438   * @see Sample#setDisease Sample#setDisease for specification examples
439   * @see Sample#getDisease Sample#getDisease for validation constraints
440   * @param disease a {@code List<Parameter>} parameter.
441   * @return Sample
442  **/
443  public Sample disease(List<Parameter> disease) {
444   this.disease = disease;
445   return this;
446  }
447
448  /**
449   * Add a single diseaseItem to the disease collection.
450   *
451   * @see Sample#getDisease Sample#getDisease for validation constraints
452   * @param diseaseItem a {@code Parameter} parameter.
453   * @return Sample
454   */
455  public Sample addDiseaseItem(Parameter diseaseItem) {
456    if (this.disease == null) {
457      this.disease = new ArrayList<>();
458    }
459    this.disease.add(diseaseItem);
460    return this;
461  }
462
463   /**
464   * Disease information on the sample.
465   *
466   * @return disease
467  **/
468  @Valid
469  @ApiModelProperty(value = "Disease information on the sample.")
470  public List<Parameter> getDisease() {
471    return disease;
472  }
473
474 /**
475   * Set disease.
476   *
477   * 
478   * 
479   * @see #getDisease Sample#getDisease for validation constraints
480   * @param disease a {@code List<Parameter>} parameter.
481  **/
482  public void setDisease(List<Parameter> disease) {
483    this.disease = disease;
484  }
485
486
487 /**
488   * Builder method for description.
489   *
490   * @see Sample#setDescription Sample#setDescription for specification examples
491   * @see Sample#getDescription Sample#getDescription for validation constraints
492   * @param description a {@code String} parameter.
493   * @return Sample
494  **/
495  public Sample description(String description) {
496   this.description = description;
497   return this;
498  }
499
500   /**
501   * A free form description of the sample.
502   *
503   * @return description
504  **/
505  @ApiModelProperty(value = "A free form description of the sample.")
506  public String getDescription() {
507    return description;
508  }
509
510 /**
511   * Set description.
512   *
513   * 
514   * 
515   * @see #getDescription Sample#getDescription for validation constraints
516   * @param description a {@code String} parameter.
517  **/
518  public void setDescription(String description) {
519    this.description = description;
520  }
521
522
523  @Override
524  public boolean equals(java.lang.Object o) {
525    if (this == o) {
526      return true;
527    }
528    if (o == null || getClass() != o.getClass()) {
529      return false;
530    }
531    Sample sample = (Sample) o;
532    return Objects.equals(this.id, sample.id) &&
533        Objects.equals(this.name, sample.name) &&
534        Objects.equals(this.custom, sample.custom) &&
535        Objects.equals(this.species, sample.species) &&
536        Objects.equals(this.tissue, sample.tissue) &&
537        Objects.equals(this.cellType, sample.cellType) &&
538        Objects.equals(this.disease, sample.disease) &&
539        Objects.equals(this.description, sample.description);
540  }
541
542  @Override
543  public int hashCode() {
544    return Objects.hash(id, name, custom, species, tissue, cellType, disease, description);
545  }
546
547
548  @Override
549  public String toString() {
550    StringBuilder sb = new StringBuilder();
551    sb.append("class Sample {\n");
552    
553    sb.append("    id: ").append(toIndentedString(id)).append("\n");
554    sb.append("    name: ").append(toIndentedString(name)).append("\n");
555    sb.append("    custom: ").append(toIndentedString(custom)).append("\n");
556    sb.append("    species: ").append(toIndentedString(species)).append("\n");
557    sb.append("    tissue: ").append(toIndentedString(tissue)).append("\n");
558    sb.append("    cellType: ").append(toIndentedString(cellType)).append("\n");
559    sb.append("    disease: ").append(toIndentedString(disease)).append("\n");
560    sb.append("    description: ").append(toIndentedString(description)).append("\n");
561    sb.append("}");
562    return sb.toString();
563  }
564
565  /**
566   * Convert the given object to string with each line indented by 4 spaces
567   * (except the first line).
568   */
569  private String toIndentedString(java.lang.Object o) {
570    if (o == null) {
571      return "null";
572    }
573    return o.toString().replace("\n", "\n    ");
574  }
575
576}
577