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 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 * Defines the used unit for a column in the mzTab-M file. The format of the value has to be \{column name}=\{Parameter defining the unit}. This field MUST NOT be used to define a unit for quantification columns. The unit used for small molecule quantification values MUST be set in small_molecule-quantification_unit. 032 * 033 * 034 * <p>mzTab-M specification example(s):</p> 035 * <pre><code>COM colunit for optional small molecule summary column with the name 'opt_global_cv_MS:MS:1002954_collisional_cross_sectional_area' 036MTD colunit-small_molecule opt_global_cv_MS:MS:1002954_collisional_cross_sectional_area=[UO,UO:00003241, square angstrom,] 037</code></pre> 038 * 039 * 040 */ 041@ApiModel(description = "Defines the used unit for a column in the mzTab-M file. The format of the value has to be \\{column name}=\\{Parameter defining the unit}. This field MUST NOT be used to define a unit for quantification columns. The unit used for small molecule quantification values MUST be set in small_molecule-quantification_unit.") 042@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-02-11T15:12:05.057+01:00") 043@XmlRootElement(name = "ColumnParameterMapping") 044@XmlAccessorType(XmlAccessType.FIELD) 045@JacksonXmlRootElement(localName = "ColumnParameterMapping") 046public class ColumnParameterMapping { 047 048 /** 049 * Property enumeration for ColumnParameterMapping. 050 */ 051 public static enum Properties { 052 columnName("column_name"), 053 param("param"); 054 055 private final String propertyName; 056 057 private Properties(String propertyName) { 058 this.propertyName = propertyName; 059 } 060 061 public String getPropertyName() { 062 return propertyName; 063 } 064 065 public String toString() { 066 return propertyName; 067 } 068 069 public String toUpper() { 070 return propertyName.toUpperCase(); 071 } 072 073 public static Properties of(String value) { 074 if(value==null) { 075 throw new NullPointerException("Argument value must not be null!"); 076 } 077 return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new); 078 } 079 }; 080 081 @JsonProperty("column_name") 082 @JacksonXmlProperty(localName = "column_name") 083 @XmlElement(name = "column_name") 084 private String columnName = null; 085 @JsonProperty("param") 086 @JacksonXmlProperty(localName = "param") 087 @XmlElement(name = "param") 088 private Parameter param = null; 089 090 /** 091 * Builder method for columnName. 092 * 093 * @see ColumnParameterMapping#setColumnName ColumnParameterMapping#setColumnName for specification examples 094 * @see ColumnParameterMapping#getColumnName ColumnParameterMapping#getColumnName for validation constraints 095 * @param columnName a {@code String} parameter. 096 * @return ColumnParameterMapping 097 **/ 098 public ColumnParameterMapping columnName(String columnName) { 099 this.columnName = columnName; 100 return this; 101 } 102 103 /** 104 * The fully qualified target column name. 105 * 106 * @return columnName 107 **/ 108 @NotNull 109 @ApiModelProperty(required = true, value = "The fully qualified target column name.") 110 public String getColumnName() { 111 return columnName; 112 } 113 114 /** 115 * Set columnName. 116 * 117 * 118 * 119 * @see #getColumnName ColumnParameterMapping#getColumnName for validation constraints 120 * @param columnName a {@code String} parameter. 121 **/ 122 public void setColumnName(String columnName) { 123 this.columnName = columnName; 124 } 125 126 127 /** 128 * Builder method for param. 129 * 130 * @see ColumnParameterMapping#setParam ColumnParameterMapping#setParam for specification examples 131 * @see ColumnParameterMapping#getParam ColumnParameterMapping#getParam for validation constraints 132 * @param param a {@code Parameter} parameter. 133 * @return ColumnParameterMapping 134 **/ 135 public ColumnParameterMapping param(Parameter param) { 136 this.param = param; 137 return this; 138 } 139 140 /** 141 * The parameter specifying the unit. 142 * 143 * @return param 144 **/ 145 @NotNull 146 @Valid 147 @ApiModelProperty(required = true, value = "The parameter specifying the unit.") 148 public Parameter getParam() { 149 return param; 150 } 151 152 /** 153 * Set param. 154 * 155 * 156 * 157 * @see #getParam ColumnParameterMapping#getParam for validation constraints 158 * @param param a {@code Parameter} parameter. 159 **/ 160 public void setParam(Parameter param) { 161 this.param = param; 162 } 163 164 165 @Override 166 public boolean equals(java.lang.Object o) { 167 if (this == o) { 168 return true; 169 } 170 if (o == null || getClass() != o.getClass()) { 171 return false; 172 } 173 ColumnParameterMapping columnParameterMapping = (ColumnParameterMapping) o; 174 return Objects.equals(this.columnName, columnParameterMapping.columnName) && 175 Objects.equals(this.param, columnParameterMapping.param); 176 } 177 178 @Override 179 public int hashCode() { 180 return Objects.hash(columnName, param); 181 } 182 183 184 @Override 185 public String toString() { 186 StringBuilder sb = new StringBuilder(); 187 sb.append("class ColumnParameterMapping {\n"); 188 189 sb.append(" columnName: ").append(toIndentedString(columnName)).append("\n"); 190 sb.append(" param: ").append(toIndentedString(param)).append("\n"); 191 sb.append("}"); 192 return sb.toString(); 193 } 194 195 /** 196 * Convert the given object to string with each line indented by 4 spaces 197 * (except the first line). 198 */ 199 private String toIndentedString(java.lang.Object o) { 200 if (o == null) { 201 return "null"; 202 } 203 return o.toString().replace("\n", "\n "); 204 } 205 206} 207