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 * 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. 035 036 * 037 * 038 * <p>mzTab-M specification example(s):</p> 039 * <pre><code>MTD sample_processing[1] [MSIO, MSIO:0000107, metabolism quenching using precooled 60 percent methanol ammonium bicarbonate buffer,] 040MTD sample_processing[2] [MSIO, MSIO:0000146, centrifugation,] 041MTD sample_processing[3] [MSIO, MSIO:0000141, metabolite extraction,] 042MTD sample_processing[4] [MSIO, MSIO:0000141, silylation,] 043</code></pre> 044 * 045 * 046 */ 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 = "2020-02-11T15:12:05.057+01:00") 049@XmlRootElement(name = "SampleProcessing") 050@XmlAccessorType(XmlAccessType.FIELD) 051@JacksonXmlRootElement(localName = "SampleProcessing") 052public class SampleProcessing extends IndexedElement { 053 054 /** 055 * Property enumeration for SampleProcessing. 056 */ 057 public static enum Properties { 058 sampleProcessing("sampleProcessing"); 059 060 private final String propertyName; 061 062 private Properties(String propertyName) { 063 this.propertyName = propertyName; 064 } 065 066 public String getPropertyName() { 067 return propertyName; 068 } 069 070 public String toString() { 071 return propertyName; 072 } 073 074 public String toUpper() { 075 return propertyName.toUpperCase(); 076 } 077 078 public static Properties of(String value) { 079 if(value==null) { 080 throw new NullPointerException("Argument value must not be null!"); 081 } 082 return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new); 083 } 084 }; 085 086 @JsonProperty("sampleProcessing") 087 // Is a container wrapped=false 088 // items.name=sampleProcessing items.baseName=sampleProcessing items.xmlName= items.xmlNamespace= 089 // items.example= items.type=Parameter 090 @XmlElement(name = "sampleProcessing") 091 private List<Parameter> sampleProcessing = null; 092 093 @Override 094 public SampleProcessing id(Integer id) { 095 super.setId(id); 096 return this; 097 } 098 099 @Override 100 public SampleProcessing elementType(String elementType) { 101 super.setElementType(elementType); 102 return this; 103 } 104 105 /** 106 * Builder method for sampleProcessing. 107 * 108 * @see SampleProcessing#setSampleProcessing SampleProcessing#setSampleProcessing for specification examples 109 * @see SampleProcessing#getSampleProcessing SampleProcessing#getSampleProcessing for validation constraints 110 * @param sampleProcessing a {@code List<Parameter>} parameter. 111 * @return SampleProcessing 112 **/ 113 public SampleProcessing sampleProcessing(List<Parameter> sampleProcessing) { 114 this.sampleProcessing = sampleProcessing; 115 return this; 116 } 117 118 /** 119 * Add a single sampleProcessingItem to the sampleProcessing collection. 120 * 121 * @see SampleProcessing#getSampleProcessing SampleProcessing#getSampleProcessing for validation constraints 122 * @param sampleProcessingItem a {@code Parameter} parameter. 123 * @return SampleProcessing 124 */ 125 public SampleProcessing addSampleProcessingItem(Parameter sampleProcessingItem) { 126 if (this.sampleProcessing == null) { 127 this.sampleProcessing = new ArrayList<>(); 128 } 129 this.sampleProcessing.add(sampleProcessingItem); 130 return this; 131 } 132 133 /** 134 * Parameters specifiying sample processing that was applied within one step. 135 * 136 * @return sampleProcessing 137 **/ 138 @Valid 139 @ApiModelProperty(value = "Parameters specifiying sample processing that was applied within one step.") 140 public List<Parameter> getSampleProcessing() { 141 return sampleProcessing; 142 } 143 144 /** 145 * Set sampleProcessing. 146 * 147 * 148 * 149 * @see #getSampleProcessing SampleProcessing#getSampleProcessing for validation constraints 150 * @param sampleProcessing a {@code List<Parameter>} parameter. 151 **/ 152 public void setSampleProcessing(List<Parameter> sampleProcessing) { 153 this.sampleProcessing = sampleProcessing; 154 } 155 156 157 @Override 158 public boolean equals(java.lang.Object o) { 159 if (this == o) { 160 return true; 161 } 162 if (o == null || getClass() != o.getClass()) { 163 return false; 164 } 165 SampleProcessing sampleProcessing = (SampleProcessing) o; 166 return Objects.equals(this.sampleProcessing, sampleProcessing.sampleProcessing) && 167 super.equals(o); 168 } 169 170 @Override 171 public int hashCode() { 172 return Objects.hash(sampleProcessing, super.hashCode()); 173 } 174 175 176 @Override 177 public String toString() { 178 StringBuilder sb = new StringBuilder(); 179 sb.append("class SampleProcessing {\n"); 180 sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 181 sb.append(" sampleProcessing: ").append(toIndentedString(sampleProcessing)).append("\n"); 182 sb.append("}"); 183 return sb.toString(); 184 } 185 186 /** 187 * Convert the given object to string with each line indented by 4 spaces 188 * (except the first line). 189 */ 190 private String toIndentedString(java.lang.Object o) { 191 if (o == null) { 192 return "null"; 193 } 194 return o.toString().replace("\n", "\n "); 195 } 196 197} 198