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.MsRun;
022import io.swagger.annotations.ApiModel;
023import io.swagger.annotations.ApiModelProperty;
024import com.fasterxml.jackson.dataformat.xml.annotation.*;
025import javax.xml.bind.annotation.*;
026import javax.validation.constraints.*;
027import javax.validation.Valid;
028import de.isas.lipidomics.mztab2.validation.constraints.*;
029/**
030 * 
031 * Reference to a spectrum in a spectrum file, for example a fragmentation spectrum has been used to support the identification. If a separate spectrum file has been used for fragmentation spectrum, this MUST be reported in the metadata section as additional ms_runs. The reference must be in the format ms_run[1-n]:{SPECTRA_REF} where SPECTRA_REF MUST follow the format defined in 5.2 (including references to chromatograms where these are used to inform identification). Multiple spectra MUST be referenced using a “|” delimited list for the (rare) cases in which search engines have combined or aggregated multiple spectra in advance of the search to make identifications.
032
033If a fragmentation spectrum has not been used, the value should indicate the ms_run to which is identification is mapped e.g. “ms_run[1]”.
034
035 * 
036 *
037 * <p>mzTab-M specification example(s):</p>
038 * <pre><code>SEH       SME_ID  …       spectra_ref     …
039SME     1                       ms_run[1]:index=5       …
040</code></pre>
041 * 
042 *
043 */
044@ApiModel(description = "Reference to a spectrum in a spectrum file, for example a fragmentation spectrum has been used to support the identification. If a separate spectrum file has been used for fragmentation spectrum, this MUST be reported in the metadata section as additional ms_runs. The reference must be in the format ms_run[1-n]:{SPECTRA_REF} where SPECTRA_REF MUST follow the format defined in 5.2 (including references to chromatograms where these are used to inform identification). Multiple spectra MUST be referenced using a “|” delimited list for the (rare) cases in which search engines have combined or aggregated multiple spectra in advance of the search to make identifications.  If a fragmentation spectrum has not been used, the value should indicate the ms_run to which is identification is mapped e.g. “ms_run[1]”. ")
045@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-08-07T11:09:24.487+02:00")
046@XmlRootElement(name = "SpectraRef")
047@XmlAccessorType(XmlAccessType.FIELD)
048@JacksonXmlRootElement(localName = "SpectraRef")
049public class SpectraRef {
050
051  /**
052   * Property enumeration for SpectraRef.
053   */
054  public static enum Properties {
055      msRun("ms_run"), 
056      reference("reference");
057
058    private final String propertyName;
059
060    private Properties(String propertyName) {
061      this.propertyName = propertyName;
062    }
063
064    public String getPropertyName() {
065      return propertyName;
066    }
067
068    public String toString() {
069      return propertyName;
070    }
071
072    public String toUpper() {
073      return propertyName.toUpperCase();
074    }
075
076    public static Properties of(String value) {
077      if(value==null) {
078        throw new NullPointerException("Argument value must not be null!");
079      }
080      return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new);
081    }
082  };
083  
084  @JsonProperty("ms_run")
085  @JacksonXmlProperty(localName = "ms_run")
086  @XmlElement(name = "ms_run")
087  private MsRun msRun = null;
088  @JsonProperty("reference")
089  @JacksonXmlProperty(localName = "reference")
090  @XmlElement(name = "reference")
091  private String reference = null;
092
093 /**
094   * Builder method for msRun.
095   *
096   * @see SpectraRef#setMsRun SpectraRef#setMsRun for specification examples
097   * @see SpectraRef#getMsRun SpectraRef#getMsRun for validation constraints
098   * @param msRun a {@code MsRun} parameter.
099   * @return SpectraRef
100  **/
101  public SpectraRef msRun(MsRun msRun) {
102   this.msRun = msRun;
103   return this;
104  }
105
106   /**
107   * The ms run object reference by this spectral reference.
108
109   *
110   * @return msRun
111  **/
112  @NotNull
113  @Valid
114  @ApiModelProperty(required = true, value = "The ms run object reference by this spectral reference. ")
115  public MsRun getMsRun() {
116    return msRun;
117  }
118
119 /**
120   * Set msRun.
121   *
122   * 
123   * 
124   * @see #getMsRun SpectraRef#getMsRun for validation constraints
125   * @param msRun a {@code MsRun} parameter.
126  **/
127  public void setMsRun(MsRun msRun) {
128    this.msRun = msRun;
129  }
130
131
132 /**
133   * Builder method for reference.
134   *
135   * @see SpectraRef#setReference SpectraRef#setReference for specification examples
136   * @see SpectraRef#getReference SpectraRef#getReference for validation constraints
137   * @param reference a {@code String} parameter.
138   * @return SpectraRef
139  **/
140  public SpectraRef reference(String reference) {
141   this.reference = reference;
142   return this;
143  }
144
145   /**
146   * The (vendor-dependendent) reference string to the actual mass spectrum.
147
148   *
149   * @return reference
150  **/
151  @NotNull
152  @ApiModelProperty(required = true, value = "The (vendor-dependendent) reference string to the actual mass spectrum. ")
153  public String getReference() {
154    return reference;
155  }
156
157 /**
158   * Set reference.
159   *
160   * 
161   * 
162   * @see #getReference SpectraRef#getReference for validation constraints
163   * @param reference a {@code String} parameter.
164  **/
165  public void setReference(String reference) {
166    this.reference = reference;
167  }
168
169
170  @Override
171  public boolean equals(java.lang.Object o) {
172    if (this == o) {
173      return true;
174    }
175    if (o == null || getClass() != o.getClass()) {
176      return false;
177    }
178    SpectraRef spectraRef = (SpectraRef) o;
179    return Objects.equals(this.msRun, spectraRef.msRun) &&
180        Objects.equals(this.reference, spectraRef.reference);
181  }
182
183  @Override
184  public int hashCode() {
185    return Objects.hash(msRun, reference);
186  }
187
188
189  @Override
190  public String toString() {
191    StringBuilder sb = new StringBuilder();
192    sb.append("class SpectraRef {\n");
193    
194    sb.append("    msRun: ").append(toIndentedString(msRun)).append("\n");
195    sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
196    sb.append("}");
197    return sb.toString();
198  }
199
200  /**
201   * Convert the given object to string with each line indented by 4 spaces
202   * (except the first line).
203   */
204  private String toIndentedString(java.lang.Object o) {
205    if (o == null) {
206      return "null";
207    }
208    return o.toString().replace("\n", "\n    ");
209  }
210
211}
212