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