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 de.isas.mztab2.model.Parameter;
023import io.swagger.annotations.ApiModel;
024import io.swagger.annotations.ApiModelProperty;
025import com.fasterxml.jackson.dataformat.xml.annotation.*;
026import javax.xml.bind.annotation.*;
027import javax.validation.constraints.*;
028import javax.validation.Valid;
029import de.isas.lipidomics.mztab2.validation.constraints.*;
030/**
031 * 
032 * Specification of databases.
033(empty): The description of databases used. For cases, where a known database has not been used for identification, a userParam SHOULD be inserted to describe any identification performed e.g. de novo. If no identification has been performed at all then "no database" should be inserted followed by null.
034prefix: The prefix used in the “identifier” column of data tables. For the “no database” case "null" must be used.
035version: The database version is mandatory where identification has been performed. This may be a formal version number e.g. “1.4.1”, a date of access “2016-10-27” (ISO-8601 format) or “Unknown” if there is no suitable version that can be annotated.
036uri: The URI to the database. For the “no database” case, "null" must be reported.
037
038 * 
039 *
040 * <p>mzTab-M specification example(s):</p>
041 * <pre><code>MTD       database[1]     [MIRIAM, MIR:00100079, HMDB, ]
042MTD     database[1]-prefix      hmdb
043MTD     database[1]-version     3.6
044MTD     database[1]-uri http://www.hmdb.ca/
045MTD     database[2]     [,, "de novo", ]
046MTD     database[2]-prefix      dn
047MTD     database[2]-version     Unknown
048MTD     database[2]-uri null
049MTD     database[3]     [,, "no database", null ]
050MTD     database[3]-prefix      null
051MTD     database[3]-version     Unknown
052MTD     database[3]-uri null
053</code></pre>
054 * 
055 *
056 */
057@ApiModel(description = "Specification of databases. (empty): The description of databases used. For cases, where a known database has not been used for identification, a userParam SHOULD be inserted to describe any identification performed e.g. de novo. If no identification has been performed at all then \"no database\" should be inserted followed by null. prefix: The prefix used in the “identifier” column of data tables. For the “no database” case \"null\" must be used. version: The database version is mandatory where identification has been performed. This may be a formal version number e.g. “1.4.1”, a date of access “2016-10-27” (ISO-8601 format) or “Unknown” if there is no suitable version that can be annotated. uri: The URI to the database. For the “no database” case, \"null\" must be reported. ")
058@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-02-11T15:12:05.057+01:00")
059@XmlRootElement(name = "Database")
060@XmlAccessorType(XmlAccessType.FIELD)
061@JacksonXmlRootElement(localName = "Database")
062public class Database extends IndexedElement {
063
064  /**
065   * Property enumeration for Database.
066   */
067  public static enum Properties {
068      param("param"), 
069      prefix("prefix"), 
070      version("version"), 
071      uri("uri");
072
073    private final String propertyName;
074
075    private Properties(String propertyName) {
076      this.propertyName = propertyName;
077    }
078
079    public String getPropertyName() {
080      return propertyName;
081    }
082
083    public String toString() {
084      return propertyName;
085    }
086
087    public String toUpper() {
088      return propertyName.toUpperCase();
089    }
090
091    public static Properties of(String value) {
092      if(value==null) {
093        throw new NullPointerException("Argument value must not be null!");
094      }
095      return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new);
096    }
097  };
098  
099  @JsonProperty("param")
100  @JacksonXmlProperty(localName = "param")
101  @XmlElement(name = "param")
102  private Parameter param = null;
103  @JsonProperty("prefix")
104  @JacksonXmlProperty(localName = "prefix")
105  @XmlElement(name = "prefix")
106  private String prefix = "null";
107  @JsonProperty("version")
108  @JacksonXmlProperty(localName = "version")
109  @XmlElement(name = "version")
110  private String version = null;
111  @JsonProperty("uri")
112  @JacksonXmlProperty(localName = "uri")
113  @XmlElement(name = "uri")
114  private String uri = null;
115  
116  @Override
117  public Database id(Integer id) {
118   super.setId(id);
119   return this;
120  }
121  
122  @Override
123  public Database elementType(String elementType) {
124   super.setElementType(elementType);
125   return this;
126  }
127
128 /**
129   * Builder method for param.
130   *
131   * @see Database#setParam Database#setParam for specification examples
132   * @see Database#getParam Database#getParam for validation constraints
133   * @param param a {@code Parameter} parameter.
134   * @return Database
135  **/
136  public Database param(Parameter param) {
137   this.param = param;
138   return this;
139  }
140
141   /**
142   * The parameter to identify this database.
143   *
144   * @return param
145  **/
146  @NotNull
147  @Valid
148  @ApiModelProperty(required = true, value = "The parameter to identify this database.")
149  public Parameter getParam() {
150    return param;
151  }
152
153 /**
154   * Set param.
155   *
156   * 
157   * 
158   * @see #getParam Database#getParam for validation constraints
159   * @param param a {@code Parameter} parameter.
160  **/
161  public void setParam(Parameter param) {
162    this.param = param;
163  }
164
165
166 /**
167   * Builder method for prefix.
168   *
169   * @see Database#setPrefix Database#setPrefix for specification examples
170   * @see Database#getPrefix Database#getPrefix for validation constraints
171   * @param prefix a {@code String} parameter.
172   * @return Database
173  **/
174  public Database prefix(String prefix) {
175   this.prefix = prefix;
176   return this;
177  }
178
179   /**
180   * The database prefix.
181   *
182   * @return prefix
183  **/
184  @NotNull
185  @ApiModelProperty(required = true, value = "The database prefix.")
186  public String getPrefix() {
187    return prefix;
188  }
189
190 /**
191   * Set prefix.
192   *
193   * 
194   * 
195   * @see #getPrefix Database#getPrefix for validation constraints
196   * @param prefix a {@code String} parameter.
197  **/
198  public void setPrefix(String prefix) {
199    this.prefix = prefix;
200  }
201
202
203 /**
204   * Builder method for version.
205   *
206   * @see Database#setVersion Database#setVersion for specification examples
207   * @see Database#getVersion Database#getVersion for validation constraints
208   * @param version a {@code String} parameter.
209   * @return Database
210  **/
211  public Database version(String version) {
212   this.version = version;
213   return this;
214  }
215
216   /**
217   * The database version.
218   *
219   * @return version
220  **/
221  @NotNull
222  @ApiModelProperty(required = true, value = "The database version.")
223  public String getVersion() {
224    return version;
225  }
226
227 /**
228   * Set version.
229   *
230   * 
231   * 
232   * @see #getVersion Database#getVersion for validation constraints
233   * @param version a {@code String} parameter.
234  **/
235  public void setVersion(String version) {
236    this.version = version;
237  }
238
239
240 /**
241   * Builder method for uri.
242   *
243   * @see Database#setUri Database#setUri for specification examples
244   * @see Database#getUri Database#getUri for validation constraints
245   * @param uri a {@code String} parameter.
246   * @return Database
247  **/
248  public Database uri(String uri) {
249   this.uri = uri;
250   return this;
251  }
252
253   /**
254   * The URI to the online database.
255   *
256   * @return uri
257  **/
258  @NotNull
259  @ApiModelProperty(required = true, value = "The URI to the online database.")
260  public String getUri() {
261    return uri;
262  }
263
264 /**
265   * Set uri.
266   *
267   * 
268   * 
269   * @see #getUri Database#getUri for validation constraints
270   * @param uri a {@code String} parameter.
271  **/
272  public void setUri(String uri) {
273    this.uri = uri;
274  }
275
276
277  @Override
278  public boolean equals(java.lang.Object o) {
279    if (this == o) {
280      return true;
281    }
282    if (o == null || getClass() != o.getClass()) {
283      return false;
284    }
285    Database database = (Database) o;
286    return Objects.equals(this.param, database.param) &&
287        Objects.equals(this.prefix, database.prefix) &&
288        Objects.equals(this.version, database.version) &&
289        Objects.equals(this.uri, database.uri) &&
290        super.equals(o);
291  }
292
293  @Override
294  public int hashCode() {
295    return Objects.hash(param, prefix, version, uri, super.hashCode());
296  }
297
298
299  @Override
300  public String toString() {
301    StringBuilder sb = new StringBuilder();
302    sb.append("class Database {\n");
303    sb.append("    ").append(toIndentedString(super.toString())).append("\n");
304    sb.append("    param: ").append(toIndentedString(param)).append("\n");
305    sb.append("    prefix: ").append(toIndentedString(prefix)).append("\n");
306    sb.append("    version: ").append(toIndentedString(version)).append("\n");
307    sb.append("    uri: ").append(toIndentedString(uri)).append("\n");
308    sb.append("}");
309    return sb.toString();
310  }
311
312  /**
313   * Convert the given object to string with each line indented by 4 spaces
314   * (except the first line).
315   */
316  private String toIndentedString(java.lang.Object o) {
317    if (o == null) {
318      return "null";
319    }
320    return o.toString().replace("\n", "\n    ");
321  }
322
323}
324