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 * A list of parameters describing a sample processing, preparation or handling step similar to a biological or analytical methods report. The order of the sample_processing items should reflect the order these processing steps were performed in. If multiple parameters are given for a step these MUST be separated by a “|”. If derivatization was performed, it MUST be reported here as a general step, e.g. 'silylation' and the actual derivatization agens MUST be specified in the Section 6.2.54 part. 034 035 * 036 * 037 * <p>mzTab-M specification example(s):</p> 038 * <pre><code>MTD sample_processing[1] [MSIO, MSIO:0000107, metabolism quenching using precooled 60 percent methanol ammonium bicarbonate buffer,] 039MTD sample_processing[2] [MSIO, MSIO:0000146, centrifugation,] 040MTD sample_processing[3] [MSIO, MSIO:0000141, metabolite extraction,] 041MTD sample_processing[4] [MSIO, MSIO:0000141, silylation,] 042</code></pre> 043 * 044 * 045 */ 046@com.fasterxml.jackson.annotation.JsonIdentityInfo(generator = com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator.class, property = "id", scope = SampleProcessing.class) 047@ApiModel(description = "A list of parameters describing a sample processing, preparation or handling step similar to a biological or analytical methods report. The order of the sample_processing items should reflect the order these processing steps were performed in. If multiple parameters are given for a step these MUST be separated by a “|”. If derivatization was performed, it MUST be reported here as a general step, e.g. 'silylation' and the actual derivatization agens MUST be specified in the Section 6.2.54 part. ") 048@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2021-01-02T19:25:37.430+01:00") 049@XmlRootElement(name = "SampleProcessing") 050@XmlAccessorType(XmlAccessType.FIELD) 051@JacksonXmlRootElement(localName = "SampleProcessing") 052public class SampleProcessing { 053 054 /** 055 * Property enumeration for SampleProcessing. 056 */ 057 public static enum Properties { 058 id("id"), 059 sampleProcessing("sampleProcessing"); 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("id") 088 @JacksonXmlProperty(localName = "id") 089 @XmlElement(name = "id") 090 private Integer id = null; 091 @JsonProperty("sampleProcessing") 092 // Is a container wrapped=false 093 // items.name=sampleProcessing items.baseName=sampleProcessing items.xmlName= items.xmlNamespace= 094 // items.example= items.type=Parameter 095 @XmlElement(name = "sampleProcessing") 096 private List<Parameter> sampleProcessing = null; 097 098 /** 099 * Builder method for id. 100 * 101 * @see SampleProcessing#setId SampleProcessing#setId for specification examples 102 * @see SampleProcessing#getId SampleProcessing#getId for validation constraints 103 * @param id a {@code Integer} parameter. 104 * @return SampleProcessing 105 **/ 106 public SampleProcessing id(Integer id) { 107 this.id = id; 108 return this; 109 } 110 111 /** 112 * <p>Get id.</p> 113 * 114 * <p>Minimum: 1</p> 115 * @return id 116 **/ 117 @Min(1) @ApiModelProperty(value = "") 118 public Integer getId() { 119 return id; 120 } 121 122 /** 123 * Set id. 124 * 125 * 126 * 127 * @see #getId SampleProcessing#getId for validation constraints 128 * @param id a {@code Integer} parameter. 129 **/ 130 public void setId(Integer id) { 131 this.id = id; 132 } 133 134 135 /** 136 * Builder method for sampleProcessing. 137 * 138 * @see SampleProcessing#setSampleProcessing SampleProcessing#setSampleProcessing for specification examples 139 * @see SampleProcessing#getSampleProcessing SampleProcessing#getSampleProcessing for validation constraints 140 * @param sampleProcessing a {@code List<Parameter>} parameter. 141 * @return SampleProcessing 142 **/ 143 public SampleProcessing sampleProcessing(List<Parameter> sampleProcessing) { 144 this.sampleProcessing = sampleProcessing; 145 return this; 146 } 147 148 /** 149 * Add a single sampleProcessingItem to the sampleProcessing collection. 150 * 151 * @see SampleProcessing#getSampleProcessing SampleProcessing#getSampleProcessing for validation constraints 152 * @param sampleProcessingItem a {@code Parameter} parameter. 153 * @return SampleProcessing 154 */ 155 public SampleProcessing addSampleProcessingItem(Parameter sampleProcessingItem) { 156 if (this.sampleProcessing == null) { 157 this.sampleProcessing = new ArrayList<>(); 158 } 159 this.sampleProcessing.add(sampleProcessingItem); 160 return this; 161 } 162 163 /** 164 * Parameters specifiying sample processing that was applied within one step. 165 * 166 * @return sampleProcessing 167 **/ 168 @Valid 169 @ApiModelProperty(value = "Parameters specifiying sample processing that was applied within one step.") 170 public List<Parameter> getSampleProcessing() { 171 return sampleProcessing; 172 } 173 174 /** 175 * Set sampleProcessing. 176 * 177 * 178 * 179 * @see #getSampleProcessing SampleProcessing#getSampleProcessing for validation constraints 180 * @param sampleProcessing a {@code List<Parameter>} parameter. 181 **/ 182 public void setSampleProcessing(List<Parameter> sampleProcessing) { 183 this.sampleProcessing = sampleProcessing; 184 } 185 186 187 @Override 188 public boolean equals(java.lang.Object o) { 189 if (this == o) { 190 return true; 191 } 192 if (o == null || getClass() != o.getClass()) { 193 return false; 194 } 195 SampleProcessing sampleProcessing = (SampleProcessing) o; 196 return Objects.equals(this.id, sampleProcessing.id) && 197 Objects.equals(this.sampleProcessing, sampleProcessing.sampleProcessing); 198 } 199 200 @Override 201 public int hashCode() { 202 return Objects.hash(id, sampleProcessing); 203 } 204 205 206 @Override 207 public String toString() { 208 StringBuilder sb = new StringBuilder(); 209 sb.append("class SampleProcessing {\n"); 210 211 sb.append(" id: ").append(toIndentedString(id)).append("\n"); 212 sb.append(" sampleProcessing: ").append(toIndentedString(sampleProcessing)).append("\n"); 213 sb.append("}"); 214 return sb.toString(); 215 } 216 217 /** 218 * Convert the given object to string with each line indented by 4 spaces 219 * (except the first line). 220 */ 221 private String toIndentedString(java.lang.Object o) { 222 if (o == null) { 223 return "null"; 224 } 225 return o.toString().replace("\n", "\n "); 226 } 227 228} 229