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 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 databases. 032(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. 033prefix: The prefix used in the “identifier” column of data tables. For the “no database” case "null" must be used. 034version: 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. 035uri: The URI to the database. For the “no database” case, "null" must be reported. 036 037 * 038 * 039 * <p>mzTab-M specification example(s):</p> 040 * <pre><code>MTD database[1] [MIRIAM, MIR:00100079, HMDB, ] 041MTD database[1]-prefix hmdb 042MTD database[1]-version 3.6 043MTD database[1]-uri http://www.hmdb.ca/ 044MTD database[2] [,, "de novo", ] 045MTD database[2]-prefix dn 046MTD database[2]-version Unknown 047MTD database[2]-uri null 048MTD database[3] [,, "no database", null ] 049MTD database[3]-prefix null 050MTD database[3]-version Unknown 051MTD database[3]-uri null 052</code></pre> 053 * 054 * 055 */ 056@com.fasterxml.jackson.annotation.JsonIdentityInfo(generator = com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator.class, property = "id", scope = Database.class) 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 = "2021-01-02T19:26:21.550+01:00") 059@XmlRootElement(name = "Database") 060@XmlAccessorType(XmlAccessType.FIELD) 061@JacksonXmlRootElement(localName = "Database") 062public class Database { 063 064 /** 065 * Property enumeration for Database. 066 */ 067 public static enum Properties { 068 id("id"), 069 param("param"), 070 prefix("prefix"), 071 version("version"), 072 uri("uri"); 073 074 private final String propertyName; 075 076 private Properties(String propertyName) { 077 this.propertyName = propertyName; 078 } 079 080 public String getPropertyName() { 081 return propertyName; 082 } 083 084 public String toString() { 085 return propertyName; 086 } 087 088 public String toUpper() { 089 return propertyName.toUpperCase(); 090 } 091 092 public static Properties of(String value) { 093 if(value==null) { 094 throw new NullPointerException("Argument value must not be null!"); 095 } 096 return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new); 097 } 098 }; 099 100 @JsonProperty("id") 101 @JacksonXmlProperty(localName = "id") 102 @XmlElement(name = "id") 103 private Integer id = null; 104 @JsonProperty("param") 105 @JacksonXmlProperty(localName = "param") 106 @XmlElement(name = "param") 107 private Parameter param = null; 108 @JsonProperty("prefix") 109 @JacksonXmlProperty(localName = "prefix") 110 @XmlElement(name = "prefix") 111 private String prefix = "null"; 112 @JsonProperty("version") 113 @JacksonXmlProperty(localName = "version") 114 @XmlElement(name = "version") 115 private String version = null; 116 @JsonProperty("uri") 117 @JacksonXmlProperty(localName = "uri") 118 @XmlElement(name = "uri") 119 private String uri = null; 120 121 /** 122 * Builder method for id. 123 * 124 * @see Database#setId Database#setId for specification examples 125 * @see Database#getId Database#getId for validation constraints 126 * @param id a {@code Integer} parameter. 127 * @return Database 128 **/ 129 public Database id(Integer id) { 130 this.id = id; 131 return this; 132 } 133 134 /** 135 * <p>Get id.</p> 136 * 137 * <p>Minimum: 1</p> 138 * @return id 139 **/ 140 @Min(1) @ApiModelProperty(value = "") 141 public Integer getId() { 142 return id; 143 } 144 145 /** 146 * Set id. 147 * 148 * 149 * 150 * @see #getId Database#getId for validation constraints 151 * @param id a {@code Integer} parameter. 152 **/ 153 public void setId(Integer id) { 154 this.id = id; 155 } 156 157 158 /** 159 * Builder method for param. 160 * 161 * @see Database#setParam Database#setParam for specification examples 162 * @see Database#getParam Database#getParam for validation constraints 163 * @param param a {@code Parameter} parameter. 164 * @return Database 165 **/ 166 public Database param(Parameter param) { 167 this.param = param; 168 return this; 169 } 170 171 /** 172 * The parameter to identify this database. 173 * 174 * @return param 175 **/ 176 @NotNull 177 @Valid 178 @ApiModelProperty(required = true, value = "The parameter to identify this database.") 179 public Parameter getParam() { 180 return param; 181 } 182 183 /** 184 * Set param. 185 * 186 * 187 * 188 * @see #getParam Database#getParam for validation constraints 189 * @param param a {@code Parameter} parameter. 190 **/ 191 public void setParam(Parameter param) { 192 this.param = param; 193 } 194 195 196 /** 197 * Builder method for prefix. 198 * 199 * @see Database#setPrefix Database#setPrefix for specification examples 200 * @see Database#getPrefix Database#getPrefix for validation constraints 201 * @param prefix a {@code String} parameter. 202 * @return Database 203 **/ 204 public Database prefix(String prefix) { 205 this.prefix = prefix; 206 return this; 207 } 208 209 /** 210 * The database prefix. 211 * 212 * @return prefix 213 **/ 214 @NotNull 215 @ApiModelProperty(required = true, value = "The database prefix.") 216 public String getPrefix() { 217 return prefix; 218 } 219 220 /** 221 * Set prefix. 222 * 223 * 224 * 225 * @see #getPrefix Database#getPrefix for validation constraints 226 * @param prefix a {@code String} parameter. 227 **/ 228 public void setPrefix(String prefix) { 229 this.prefix = prefix; 230 } 231 232 233 /** 234 * Builder method for version. 235 * 236 * @see Database#setVersion Database#setVersion for specification examples 237 * @see Database#getVersion Database#getVersion for validation constraints 238 * @param version a {@code String} parameter. 239 * @return Database 240 **/ 241 public Database version(String version) { 242 this.version = version; 243 return this; 244 } 245 246 /** 247 * The database version. 248 * 249 * @return version 250 **/ 251 @NotNull 252 @ApiModelProperty(required = true, value = "The database version.") 253 public String getVersion() { 254 return version; 255 } 256 257 /** 258 * Set version. 259 * 260 * 261 * 262 * @see #getVersion Database#getVersion for validation constraints 263 * @param version a {@code String} parameter. 264 **/ 265 public void setVersion(String version) { 266 this.version = version; 267 } 268 269 270 /** 271 * Builder method for uri. 272 * 273 * @see Database#setUri Database#setUri for specification examples 274 * @see Database#getUri Database#getUri for validation constraints 275 * @param uri a {@code String} parameter. 276 * @return Database 277 **/ 278 public Database uri(String uri) { 279 this.uri = uri; 280 return this; 281 } 282 283 /** 284 * The URI to the online database. 285 * 286 * @return uri 287 **/ 288 @NotNull 289 @ApiModelProperty(required = true, value = "The URI to the online database.") 290 public String getUri() { 291 return uri; 292 } 293 294 /** 295 * Set uri. 296 * 297 * 298 * 299 * @see #getUri Database#getUri for validation constraints 300 * @param uri a {@code String} parameter. 301 **/ 302 public void setUri(String uri) { 303 this.uri = uri; 304 } 305 306 307 @Override 308 public boolean equals(java.lang.Object o) { 309 if (this == o) { 310 return true; 311 } 312 if (o == null || getClass() != o.getClass()) { 313 return false; 314 } 315 Database database = (Database) o; 316 return Objects.equals(this.id, database.id) && 317 Objects.equals(this.param, database.param) && 318 Objects.equals(this.prefix, database.prefix) && 319 Objects.equals(this.version, database.version) && 320 Objects.equals(this.uri, database.uri); 321 } 322 323 @Override 324 public int hashCode() { 325 return Objects.hash(id, param, prefix, version, uri); 326 } 327 328 329 @Override 330 public String toString() { 331 StringBuilder sb = new StringBuilder(); 332 sb.append("class Database {\n"); 333 334 sb.append(" id: ").append(toIndentedString(id)).append("\n"); 335 sb.append(" param: ").append(toIndentedString(param)).append("\n"); 336 sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); 337 sb.append(" version: ").append(toIndentedString(version)).append("\n"); 338 sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); 339 sb.append("}"); 340 return sb.toString(); 341 } 342 343 /** 344 * Convert the given object to string with each line indented by 4 spaces 345 * (except the first line). 346 */ 347 private String toIndentedString(java.lang.Object o) { 348 if (o == null) { 349 return "null"; 350 } 351 return o.toString().replace("\n", "\n "); 352 } 353 354} 355