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 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 * Specification of controlled vocabularies.
032label: A string describing the labels of the controlled vocabularies/ontologies used in the mzTab file as a short-hand e.g. "MS" for PSI-MS.
033full_name: A string describing the full names of the controlled vocabularies/ontologies used in the mzTab file.
034version: A string describing the version of the controlled vocabularies/ontologies used in the mzTab file.
035uri: A string containing the URIs of the controlled vocabularies/ontologies used in the mzTab file.
036
037 * 
038 *
039 * <p>mzTab-M specification example(s):</p>
040 * <pre><code>MTD       cv[1]-label     MS
041MTD     cv[1]-full_name PSI-MS controlled vocabulary
042MTD     cv[1]-version   4.1.11
043MTD     cv[1]-uri       https://raw.githubusercontent.com/HUPO-PSI/psi-ms-CV/master/psi-ms.obo
044</code></pre>
045 * 
046 *
047 */
048@ApiModel(description = "Specification of controlled vocabularies. label: A string describing the labels of the controlled vocabularies/ontologies used in the mzTab file as a short-hand e.g. \"MS\" for PSI-MS. full_name: A string describing the full names of the controlled vocabularies/ontologies used in the mzTab file. version: A string describing the version of the controlled vocabularies/ontologies used in the mzTab file. uri: A string containing the URIs of the controlled vocabularies/ontologies used in the mzTab file. ")
049@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-08-07T11:09:24.487+02:00")
050@XmlRootElement(name = "CV")
051@XmlAccessorType(XmlAccessType.FIELD)
052@JacksonXmlRootElement(localName = "CV")
053public class CV extends IndexedElement {
054
055  /**
056   * Property enumeration for CV.
057   */
058  public static enum Properties {
059      label("label"), 
060      fullName("full_name"), 
061      version("version"), 
062      uri("uri");
063
064    private final String propertyName;
065
066    private Properties(String propertyName) {
067      this.propertyName = propertyName;
068    }
069
070    public String getPropertyName() {
071      return propertyName;
072    }
073
074    public String toString() {
075      return propertyName;
076    }
077
078    public String toUpper() {
079      return propertyName.toUpperCase();
080    }
081
082    public static Properties of(String value) {
083      if(value==null) {
084        throw new NullPointerException("Argument value must not be null!");
085      }
086      return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new);
087    }
088  };
089  
090  @JsonProperty("label")
091  @JacksonXmlProperty(localName = "label")
092  @XmlElement(name = "label")
093  private String label = null;
094  @JsonProperty("full_name")
095  @JacksonXmlProperty(localName = "full_name")
096  @XmlElement(name = "full_name")
097  private String fullName = null;
098  @JsonProperty("version")
099  @JacksonXmlProperty(localName = "version")
100  @XmlElement(name = "version")
101  private String version = null;
102  @JsonProperty("uri")
103  @JacksonXmlProperty(localName = "uri")
104  @XmlElement(name = "uri")
105  private String uri = null;
106  
107  @Override
108  public CV id(Integer id) {
109   super.setId(id);
110   return this;
111  }
112  
113  @Override
114  public CV elementType(String elementType) {
115   super.setElementType(elementType);
116   return this;
117  }
118
119 /**
120   * Builder method for label.
121   *
122   * @see CV#setLabel CV#setLabel for specification examples
123   * @see CV#getLabel CV#getLabel for validation constraints
124   * @param label a {@code String} parameter.
125   * @return CV
126  **/
127  public CV label(String label) {
128   this.label = label;
129   return this;
130  }
131
132   /**
133   * The abbreviated CV label.
134   *
135   * @return label
136  **/
137  @NotNull
138  @ApiModelProperty(required = true, value = "The abbreviated CV label.")
139  public String getLabel() {
140    return label;
141  }
142
143 /**
144   * Set label.
145   *
146   * 
147   * 
148   * @see #getLabel CV#getLabel for validation constraints
149   * @param label a {@code String} parameter.
150  **/
151  public void setLabel(String label) {
152    this.label = label;
153  }
154
155
156 /**
157   * Builder method for fullName.
158   *
159   * @see CV#setFullName CV#setFullName for specification examples
160   * @see CV#getFullName CV#getFullName for validation constraints
161   * @param fullName a {@code String} parameter.
162   * @return CV
163  **/
164  public CV fullName(String fullName) {
165   this.fullName = fullName;
166   return this;
167  }
168
169   /**
170   * The full name of this CV, for humans.
171   *
172   * @return fullName
173  **/
174  @NotNull
175  @ApiModelProperty(required = true, value = "The full name of this CV, for humans.")
176  public String getFullName() {
177    return fullName;
178  }
179
180 /**
181   * Set fullName.
182   *
183   * 
184   * 
185   * @see #getFullName CV#getFullName for validation constraints
186   * @param fullName a {@code String} parameter.
187  **/
188  public void setFullName(String fullName) {
189    this.fullName = fullName;
190  }
191
192
193 /**
194   * Builder method for version.
195   *
196   * @see CV#setVersion CV#setVersion for specification examples
197   * @see CV#getVersion CV#getVersion for validation constraints
198   * @param version a {@code String} parameter.
199   * @return CV
200  **/
201  public CV version(String version) {
202   this.version = version;
203   return this;
204  }
205
206   /**
207   * The CV version used when the file was generated.
208   *
209   * @return version
210  **/
211  @NotNull
212  @ApiModelProperty(required = true, value = "The CV version used when the file was generated.")
213  public String getVersion() {
214    return version;
215  }
216
217 /**
218   * Set version.
219   *
220   * 
221   * 
222   * @see #getVersion CV#getVersion for validation constraints
223   * @param version a {@code String} parameter.
224  **/
225  public void setVersion(String version) {
226    this.version = version;
227  }
228
229
230 /**
231   * Builder method for uri.
232   *
233   * @see CV#setUri CV#setUri for specification examples
234   * @see CV#getUri CV#getUri for validation constraints
235   * @param uri a {@code String} parameter.
236   * @return CV
237  **/
238  public CV uri(String uri) {
239   this.uri = uri;
240   return this;
241  }
242
243   /**
244   * A URI to the CV definition.
245   *
246   * @return uri
247  **/
248  @NotNull
249  @ApiModelProperty(required = true, value = "A URI to the CV definition.")
250  public String getUri() {
251    return uri;
252  }
253
254 /**
255   * Set uri.
256   *
257   * 
258   * 
259   * @see #getUri CV#getUri for validation constraints
260   * @param uri a {@code String} parameter.
261  **/
262  public void setUri(String uri) {
263    this.uri = uri;
264  }
265
266
267  @Override
268  public boolean equals(java.lang.Object o) {
269    if (this == o) {
270      return true;
271    }
272    if (o == null || getClass() != o.getClass()) {
273      return false;
274    }
275    CV CV = (CV) o;
276    return Objects.equals(this.label, CV.label) &&
277        Objects.equals(this.fullName, CV.fullName) &&
278        Objects.equals(this.version, CV.version) &&
279        Objects.equals(this.uri, CV.uri) &&
280        super.equals(o);
281  }
282
283  @Override
284  public int hashCode() {
285    return Objects.hash(label, fullName, version, uri, super.hashCode());
286  }
287
288
289  @Override
290  public String toString() {
291    StringBuilder sb = new StringBuilder();
292    sb.append("class CV {\n");
293    sb.append("    ").append(toIndentedString(super.toString())).append("\n");
294    sb.append("    label: ").append(toIndentedString(label)).append("\n");
295    sb.append("    fullName: ").append(toIndentedString(fullName)).append("\n");
296    sb.append("    version: ").append(toIndentedString(version)).append("\n");
297    sb.append("    uri: ").append(toIndentedString(uri)).append("\n");
298    sb.append("}");
299    return sb.toString();
300  }
301
302  /**
303   * Convert the given object to string with each line indented by 4 spaces
304   * (except the first line).
305   */
306  private String toIndentedString(java.lang.Object o) {
307    if (o == null) {
308      return "null";
309    }
310    return o.toString().replace("\n", "\n    ");
311  }
312
313}
314