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 * 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. 032Parameters are always reported as [CV label, accession, name, value]. Any field that is not available MUST be left empty. 033 034 * 035 * 036 * <p>mzTab-M specification example(s):</p> 037 * <pre><code>[MS, MS:1001477, SpectraST,] 038[,,A user parameter, The value] 039</code></pre> 040 * 041 * 042 */ 043@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. ") 044@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-02-11T15:11:41.249+01:00") 045@XmlRootElement(name = "Parameter") 046@XmlAccessorType(XmlAccessType.FIELD) 047@JacksonXmlRootElement(localName = "Parameter") 048public class Parameter extends IndexedElement { 049 050 /** 051 * Property enumeration for Parameter. 052 */ 053 public static enum Properties { 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("cv_label") 086 @JacksonXmlProperty(localName = "cv_label") 087 @XmlElement(name = "cv_label") 088 private String cvLabel = ""; 089 @JsonProperty("cv_accession") 090 @JacksonXmlProperty(localName = "cv_accession") 091 @XmlElement(name = "cv_accession") 092 private String cvAccession = ""; 093 @JsonProperty("name") 094 @JacksonXmlProperty(localName = "name") 095 @XmlElement(name = "name") 096 private String name = null; 097 @JsonProperty("value") 098 @JacksonXmlProperty(localName = "value") 099 @XmlElement(name = "value") 100 private String value = ""; 101 102 @Override 103 public Parameter id(Integer id) { 104 super.setId(id); 105 return this; 106 } 107 108 @Override 109 public Parameter elementType(String elementType) { 110 super.setElementType(elementType); 111 return this; 112 } 113 114 /** 115 * Builder method for cvLabel. 116 * 117 * @see Parameter#setCvLabel Parameter#setCvLabel for specification examples 118 * @see Parameter#getCvLabel Parameter#getCvLabel for validation constraints 119 * @param cvLabel a {@code String} parameter. 120 * @return Parameter 121 **/ 122 public Parameter cvLabel(String cvLabel) { 123 this.cvLabel = cvLabel; 124 return this; 125 } 126 127 /** 128 * <p>Get cvLabel.</p> 129 * 130 * @return cvLabel 131 **/ 132 @ApiModelProperty(value = "") 133 public String getCvLabel() { 134 return cvLabel; 135 } 136 137 /** 138 * Set cvLabel. 139 * 140 * 141 * 142 * @see #getCvLabel Parameter#getCvLabel for validation constraints 143 * @param cvLabel a {@code String} parameter. 144 **/ 145 public void setCvLabel(String cvLabel) { 146 this.cvLabel = cvLabel; 147 } 148 149 150 /** 151 * Builder method for cvAccession. 152 * 153 * @see Parameter#setCvAccession Parameter#setCvAccession for specification examples 154 * @see Parameter#getCvAccession Parameter#getCvAccession for validation constraints 155 * @param cvAccession a {@code String} parameter. 156 * @return Parameter 157 **/ 158 public Parameter cvAccession(String cvAccession) { 159 this.cvAccession = cvAccession; 160 return this; 161 } 162 163 /** 164 * <p>Get cvAccession.</p> 165 * 166 * @return cvAccession 167 **/ 168 @ApiModelProperty(value = "") 169 public String getCvAccession() { 170 return cvAccession; 171 } 172 173 /** 174 * Set cvAccession. 175 * 176 * 177 * 178 * @see #getCvAccession Parameter#getCvAccession for validation constraints 179 * @param cvAccession a {@code String} parameter. 180 **/ 181 public void setCvAccession(String cvAccession) { 182 this.cvAccession = cvAccession; 183 } 184 185 186 /** 187 * Builder method for name. 188 * 189 * @see Parameter#setName Parameter#setName for specification examples 190 * @see Parameter#getName Parameter#getName for validation constraints 191 * @param name a {@code String} parameter. 192 * @return Parameter 193 **/ 194 public Parameter name(String name) { 195 this.name = name; 196 return this; 197 } 198 199 /** 200 * <p>Get name.</p> 201 * 202 * @return name 203 **/ 204 @NotNull 205 @ApiModelProperty(required = true, value = "") 206 public String getName() { 207 return name; 208 } 209 210 /** 211 * Set name. 212 * 213 * 214 * 215 * @see #getName Parameter#getName for validation constraints 216 * @param name a {@code String} parameter. 217 **/ 218 public void setName(String name) { 219 this.name = name; 220 } 221 222 223 /** 224 * Builder method for value. 225 * 226 * @see Parameter#setValue Parameter#setValue for specification examples 227 * @see Parameter#getValue Parameter#getValue for validation constraints 228 * @param value a {@code String} parameter. 229 * @return Parameter 230 **/ 231 public Parameter value(String value) { 232 this.value = value; 233 return this; 234 } 235 236 /** 237 * <p>Get value.</p> 238 * 239 * @return value 240 **/ 241 @NotNull 242 @ApiModelProperty(required = true, value = "") 243 public String getValue() { 244 return value; 245 } 246 247 /** 248 * Set value. 249 * 250 * 251 * 252 * @see #getValue Parameter#getValue for validation constraints 253 * @param value a {@code String} parameter. 254 **/ 255 public void setValue(String value) { 256 this.value = value; 257 } 258 259 260 @Override 261 public boolean equals(java.lang.Object o) { 262 if (this == o) { 263 return true; 264 } 265 if (o == null || getClass() != o.getClass()) { 266 return false; 267 } 268 Parameter parameter = (Parameter) o; 269 return Objects.equals(this.cvLabel, parameter.cvLabel) && 270 Objects.equals(this.cvAccession, parameter.cvAccession) && 271 Objects.equals(this.name, parameter.name) && 272 Objects.equals(this.value, parameter.value) && 273 super.equals(o); 274 } 275 276 @Override 277 public int hashCode() { 278 return Objects.hash(cvLabel, cvAccession, name, value, super.hashCode()); 279 } 280 281 282 @Override 283 public String toString() { 284 StringBuilder sb = new StringBuilder(); 285 sb.append("class Parameter {\n"); 286 sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 287 sb.append(" cvLabel: ").append(toIndentedString(cvLabel)).append("\n"); 288 sb.append(" cvAccession: ").append(toIndentedString(cvAccession)).append("\n"); 289 sb.append(" name: ").append(toIndentedString(name)).append("\n"); 290 sb.append(" value: ").append(toIndentedString(value)).append("\n"); 291 sb.append("}"); 292 return sb.toString(); 293 } 294 295 /** 296 * Convert the given object to string with each line indented by 4 spaces 297 * (except the first line). 298 */ 299 private String toIndentedString(java.lang.Object o) { 300 if (o == null) { 301 return "null"; 302 } 303 return o.toString().replace("\n", "\n "); 304 } 305 306} 307