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 java.util.ArrayList; 025import java.util.List; 026import com.fasterxml.jackson.dataformat.xml.annotation.*; 027import javax.xml.bind.annotation.*; 028import javax.validation.constraints.*; 029import javax.validation.Valid; 030import de.isas.lipidomics.mztab2.validation.constraints.*; 031/** 032 * 033 * Software used to analyze the data and obtain the reported results. The parameter’s value SHOULD contain the software’s version. The order (numbering) should reflect the order in which the tools were used. A software setting used. This field MAY occur multiple times for a single software. The value of this field is deliberately set as a String, since there currently do not exist CV terms for every possible setting. 034 035 * 036 * 037 * <p>mzTab-M specification example(s):</p> 038 * <pre><code>MTD software[1] [MS, MS:1002879, Progenesis QI, 3.0] 039MTD software[1]-setting Fragment tolerance = 0.1 Da 040… 041MTD software[2]-setting Parent tolerance = 0.5 Da 042</code></pre> 043 * 044 * 045 */ 046@com.fasterxml.jackson.annotation.JsonIdentityInfo(generator = com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator.class, property = "id", scope = Software.class) 047@ApiModel(description = "Software used to analyze the data and obtain the reported results. The parameter’s value SHOULD contain the software’s version. The order (numbering) should reflect the order in which the tools were used. A software setting used. This field MAY occur multiple times for a single software. The value of this field is deliberately set as a String, since there currently do not exist CV terms for every possible setting. ") 048@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2021-01-02T19:25:37.430+01:00") 049@XmlRootElement(name = "Software") 050@XmlAccessorType(XmlAccessType.FIELD) 051@JacksonXmlRootElement(localName = "Software") 052public class Software { 053 054 /** 055 * Property enumeration for Software. 056 */ 057 public static enum Properties { 058 id("id"), 059 parameter("parameter"), 060 setting("setting"); 061 062 private final String propertyName; 063 064 private Properties(String propertyName) { 065 this.propertyName = propertyName; 066 } 067 068 public String getPropertyName() { 069 return propertyName; 070 } 071 072 public String toString() { 073 return propertyName; 074 } 075 076 public String toUpper() { 077 return propertyName.toUpperCase(); 078 } 079 080 public static Properties of(String value) { 081 if(value==null) { 082 throw new NullPointerException("Argument value must not be null!"); 083 } 084 return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new); 085 } 086 }; 087 088 @JsonProperty("id") 089 @JacksonXmlProperty(localName = "id") 090 @XmlElement(name = "id") 091 private Integer id = null; 092 @JsonProperty("parameter") 093 @JacksonXmlProperty(localName = "parameter") 094 @XmlElement(name = "parameter") 095 private Parameter parameter = null; 096 @JsonProperty("setting") 097 // Is a container wrapped=false 098 // items.name=setting items.baseName=setting items.xmlName= items.xmlNamespace= 099 // items.example= items.type=String 100 @XmlElement(name = "setting") 101 private List<String> setting = null; 102 103 /** 104 * Builder method for id. 105 * 106 * @see Software#setId Software#setId for specification examples 107 * @see Software#getId Software#getId for validation constraints 108 * @param id a {@code Integer} parameter. 109 * @return Software 110 **/ 111 public Software id(Integer id) { 112 this.id = id; 113 return this; 114 } 115 116 /** 117 * <p>Get id.</p> 118 * 119 * <p>Minimum: 1</p> 120 * @return id 121 **/ 122 @Min(1) @ApiModelProperty(value = "") 123 public Integer getId() { 124 return id; 125 } 126 127 /** 128 * Set id. 129 * 130 * 131 * 132 * @see #getId Software#getId for validation constraints 133 * @param id a {@code Integer} parameter. 134 **/ 135 public void setId(Integer id) { 136 this.id = id; 137 } 138 139 140 /** 141 * Builder method for parameter. 142 * 143 * @see Software#setParameter Software#setParameter for specification examples 144 * @see Software#getParameter Software#getParameter for validation constraints 145 * @param parameter a {@code Parameter} parameter. 146 * @return Software 147 **/ 148 public Software parameter(Parameter parameter) { 149 this.parameter = parameter; 150 return this; 151 } 152 153 /** 154 * Parameter defining the software being used. 155 * 156 * @return parameter 157 **/ 158 @Valid 159 @ApiModelProperty(value = "Parameter defining the software being used.") 160 public Parameter getParameter() { 161 return parameter; 162 } 163 164 /** 165 * Set parameter. 166 * 167 * 168 * 169 * @see #getParameter Software#getParameter for validation constraints 170 * @param parameter a {@code Parameter} parameter. 171 **/ 172 public void setParameter(Parameter parameter) { 173 this.parameter = parameter; 174 } 175 176 177 /** 178 * Builder method for setting. 179 * 180 * @see Software#setSetting Software#setSetting for specification examples 181 * @see Software#getSetting Software#getSetting for validation constraints 182 * @param setting a {@code List<String>} parameter. 183 * @return Software 184 **/ 185 public Software setting(List<String> setting) { 186 this.setting = setting; 187 return this; 188 } 189 190 /** 191 * Add a single settingItem to the setting collection. 192 * 193 * @see Software#getSetting Software#getSetting for validation constraints 194 * @param settingItem a {@code String} parameter. 195 * @return Software 196 */ 197 public Software addSettingItem(String settingItem) { 198 if (this.setting == null) { 199 this.setting = new ArrayList<>(); 200 } 201 this.setting.add(settingItem); 202 return this; 203 } 204 205 /** 206 * A software setting used. This field MAY occur multiple times for a 207single software. The value of this field is deliberately set as a 208String, since there currently do not exist cvParams for every 209possible setting. 210 211 * 212 * @return setting 213 **/ 214 @ApiModelProperty(value = "A software setting used. This field MAY occur multiple times for a single software. The value of this field is deliberately set as a String, since there currently do not exist cvParams for every possible setting. ") 215 public List<String> getSetting() { 216 return setting; 217 } 218 219 /** 220 * Set setting. 221 * 222 * 223 * 224 * @see #getSetting Software#getSetting for validation constraints 225 * @param setting a {@code List<String>} parameter. 226 **/ 227 public void setSetting(List<String> setting) { 228 this.setting = setting; 229 } 230 231 232 @Override 233 public boolean equals(java.lang.Object o) { 234 if (this == o) { 235 return true; 236 } 237 if (o == null || getClass() != o.getClass()) { 238 return false; 239 } 240 Software software = (Software) o; 241 return Objects.equals(this.id, software.id) && 242 Objects.equals(this.parameter, software.parameter) && 243 Objects.equals(this.setting, software.setting); 244 } 245 246 @Override 247 public int hashCode() { 248 return Objects.hash(id, parameter, setting); 249 } 250 251 252 @Override 253 public String toString() { 254 StringBuilder sb = new StringBuilder(); 255 sb.append("class Software {\n"); 256 257 sb.append(" id: ").append(toIndentedString(id)).append("\n"); 258 sb.append(" parameter: ").append(toIndentedString(parameter)).append("\n"); 259 sb.append(" setting: ").append(toIndentedString(setting)).append("\n"); 260 sb.append("}"); 261 return sb.toString(); 262 } 263 264 /** 265 * Convert the given object to string with each line indented by 4 spaces 266 * (except the first line). 267 */ 268 private String toIndentedString(java.lang.Object o) { 269 if (o == null) { 270 return "null"; 271 } 272 return o.toString().replace("\n", "\n "); 273 } 274 275} 276