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 io.swagger.annotations.ApiModel;
022import io.swagger.annotations.ApiModelProperty;
023import com.fasterxml.jackson.dataformat.xml.annotation.*;
024import javax.xml.bind.annotation.*;
025import javax.validation.constraints.*;
026import javax.validation.Valid;
027import de.isas.lipidomics.mztab2.validation.constraints.*;
028/**
029 * 
030 * mzTab makes use of CV parameters. As mzTab is expected to be used in several experimental environments where parameters might not yet be available for the generated scores etc. all parameters can either report CV parameters or user parameters that only contain a name and a value.
031Parameters are always reported as [CV label, accession, name, value]. Any field that is not available MUST be left empty.
032
033 * 
034 *
035 * <p>mzTab-M specification example(s):</p>
036 * <pre><code>[MS, MS:1001477, SpectraST,]
037[,,A user parameter, The value]
038</code></pre>
039 * 
040 *
041 */
042@ApiModel(description = "mzTab makes use of CV parameters. As mzTab is expected to be used in several experimental environments where parameters might not yet be available for the generated scores etc. all parameters can either report CV parameters or user parameters that only contain a name and a value. Parameters are always reported as [CV label, accession, name, value]. Any field that is not available MUST be left empty. ")
043@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2021-01-02T19:25:37.430+01:00")
044@XmlRootElement(name = "Parameter")
045@XmlAccessorType(XmlAccessType.FIELD)
046@JacksonXmlRootElement(localName = "Parameter")
047public class Parameter {
048
049  /**
050   * Property enumeration for Parameter.
051   */
052  public static enum Properties {
053      id("id"), 
054      cvLabel("cv_label"), 
055      cvAccession("cv_accession"), 
056      name("name"), 
057      value("value");
058
059    private final String propertyName;
060
061    private Properties(String propertyName) {
062      this.propertyName = propertyName;
063    }
064
065    public String getPropertyName() {
066      return propertyName;
067    }
068
069    public String toString() {
070      return propertyName;
071    }
072
073    public String toUpper() {
074      return propertyName.toUpperCase();
075    }
076
077    public static Properties of(String value) {
078      if(value==null) {
079        throw new NullPointerException("Argument value must not be null!");
080      }
081      return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new);
082    }
083  };
084  
085  @JsonProperty("id")
086  @JacksonXmlProperty(localName = "id")
087  @XmlElement(name = "id")
088  private Integer id = null;
089  @JsonProperty("cv_label")
090  @JacksonXmlProperty(localName = "cv_label")
091  @XmlElement(name = "cv_label")
092  private String cvLabel = "";
093  @JsonProperty("cv_accession")
094  @JacksonXmlProperty(localName = "cv_accession")
095  @XmlElement(name = "cv_accession")
096  private String cvAccession = "";
097  @JsonProperty("name")
098  @JacksonXmlProperty(localName = "name")
099  @XmlElement(name = "name")
100  private String name = null;
101  @JsonProperty("value")
102  @JacksonXmlProperty(localName = "value")
103  @XmlElement(name = "value")
104  private String value = "";
105
106 /**
107   * Builder method for id.
108   *
109   * @see Parameter#setId Parameter#setId for specification examples
110   * @see Parameter#getId Parameter#getId for validation constraints
111   * @param id a {@code Integer} parameter.
112   * @return Parameter
113  **/
114  public Parameter id(Integer id) {
115   this.id = id;
116   return this;
117  }
118
119   /**
120   * <p>Get id.</p>
121   *
122   * <p>Minimum: 1</p>
123   * @return id
124  **/
125 @Min(1)  @ApiModelProperty(value = "")
126  public Integer getId() {
127    return id;
128  }
129
130 /**
131   * Set id.
132   *
133   * 
134   * 
135   * @see #getId Parameter#getId for validation constraints
136   * @param id a {@code Integer} parameter.
137  **/
138  public void setId(Integer id) {
139    this.id = id;
140  }
141
142
143 /**
144   * Builder method for cvLabel.
145   *
146   * @see Parameter#setCvLabel Parameter#setCvLabel for specification examples
147   * @see Parameter#getCvLabel Parameter#getCvLabel for validation constraints
148   * @param cvLabel a {@code String} parameter.
149   * @return Parameter
150  **/
151  public Parameter cvLabel(String cvLabel) {
152   this.cvLabel = cvLabel;
153   return this;
154  }
155
156   /**
157   * <p>Get cvLabel.</p>
158   *
159   * @return cvLabel
160  **/
161  @ApiModelProperty(value = "")
162  public String getCvLabel() {
163    return cvLabel;
164  }
165
166 /**
167   * Set cvLabel.
168   *
169   * 
170   * 
171   * @see #getCvLabel Parameter#getCvLabel for validation constraints
172   * @param cvLabel a {@code String} parameter.
173  **/
174  public void setCvLabel(String cvLabel) {
175    this.cvLabel = cvLabel;
176  }
177
178
179 /**
180   * Builder method for cvAccession.
181   *
182   * @see Parameter#setCvAccession Parameter#setCvAccession for specification examples
183   * @see Parameter#getCvAccession Parameter#getCvAccession for validation constraints
184   * @param cvAccession a {@code String} parameter.
185   * @return Parameter
186  **/
187  public Parameter cvAccession(String cvAccession) {
188   this.cvAccession = cvAccession;
189   return this;
190  }
191
192   /**
193   * <p>Get cvAccession.</p>
194   *
195   * @return cvAccession
196  **/
197  @ApiModelProperty(value = "")
198  public String getCvAccession() {
199    return cvAccession;
200  }
201
202 /**
203   * Set cvAccession.
204   *
205   * 
206   * 
207   * @see #getCvAccession Parameter#getCvAccession for validation constraints
208   * @param cvAccession a {@code String} parameter.
209  **/
210  public void setCvAccession(String cvAccession) {
211    this.cvAccession = cvAccession;
212  }
213
214
215 /**
216   * Builder method for name.
217   *
218   * @see Parameter#setName Parameter#setName for specification examples
219   * @see Parameter#getName Parameter#getName for validation constraints
220   * @param name a {@code String} parameter.
221   * @return Parameter
222  **/
223  public Parameter name(String name) {
224   this.name = name;
225   return this;
226  }
227
228   /**
229   * <p>Get name.</p>
230   *
231   * @return name
232  **/
233  @NotNull
234  @ApiModelProperty(required = true, value = "")
235  public String getName() {
236    return name;
237  }
238
239 /**
240   * Set name.
241   *
242   * 
243   * 
244   * @see #getName Parameter#getName for validation constraints
245   * @param name a {@code String} parameter.
246  **/
247  public void setName(String name) {
248    this.name = name;
249  }
250
251
252 /**
253   * Builder method for value.
254   *
255   * @see Parameter#setValue Parameter#setValue for specification examples
256   * @see Parameter#getValue Parameter#getValue for validation constraints
257   * @param value a {@code String} parameter.
258   * @return Parameter
259  **/
260  public Parameter value(String value) {
261   this.value = value;
262   return this;
263  }
264
265   /**
266   * <p>Get value.</p>
267   *
268   * @return value
269  **/
270  @NotNull
271  @ApiModelProperty(required = true, value = "")
272  public String getValue() {
273    return value;
274  }
275
276 /**
277   * Set value.
278   *
279   * 
280   * 
281   * @see #getValue Parameter#getValue for validation constraints
282   * @param value a {@code String} parameter.
283  **/
284  public void setValue(String value) {
285    this.value = value;
286  }
287
288
289  @Override
290  public boolean equals(java.lang.Object o) {
291    if (this == o) {
292      return true;
293    }
294    if (o == null || getClass() != o.getClass()) {
295      return false;
296    }
297    Parameter parameter = (Parameter) o;
298    return Objects.equals(this.id, parameter.id) &&
299        Objects.equals(this.cvLabel, parameter.cvLabel) &&
300        Objects.equals(this.cvAccession, parameter.cvAccession) &&
301        Objects.equals(this.name, parameter.name) &&
302        Objects.equals(this.value, parameter.value);
303  }
304
305  @Override
306  public int hashCode() {
307    return Objects.hash(id, cvLabel, cvAccession, name, value);
308  }
309
310
311  @Override
312  public String toString() {
313    StringBuilder sb = new StringBuilder();
314    sb.append("class Parameter {\n");
315    
316    sb.append("    id: ").append(toIndentedString(id)).append("\n");
317    sb.append("    cvLabel: ").append(toIndentedString(cvLabel)).append("\n");
318    sb.append("    cvAccession: ").append(toIndentedString(cvAccession)).append("\n");
319    sb.append("    name: ").append(toIndentedString(name)).append("\n");
320    sb.append("    value: ").append(toIndentedString(value)).append("\n");
321    sb.append("}");
322    return sb.toString();
323  }
324
325  /**
326   * Convert the given object to string with each line indented by 4 spaces
327   * (except the first line).
328   */
329  private String toIndentedString(java.lang.Object o) {
330    if (o == null) {
331      return "null";
332    }
333    return o.toString().replace("\n", "\n    ");
334  }
335
336}
337