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 io.swagger.annotations.ApiModel; 022import io.swagger.annotations.ApiModelProperty; 023import com.fasterxml.jackson.dataformat.xml.annotation.*; 024import javax.xml.bind.annotation.*; 025import javax.validation.constraints.*; 026import javax.validation.Valid; 027import de.isas.lipidomics.mztab2.validation.constraints.*; 028/** 029 * ValidationMessage 030 * 031 * 032 * 033 */ 034@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2021-01-02T19:26:21.550+01:00") 035@XmlRootElement(name = "ValidationMessage") 036@XmlAccessorType(XmlAccessType.FIELD) 037@JacksonXmlRootElement(localName = "ValidationMessage") 038public class ValidationMessage { 039 040 /** 041 * Property enumeration for ValidationMessage. 042 */ 043 public static enum Properties { 044 code("code"), 045 category("category"), 046 messageType("message_type"), 047 message("message"), 048 lineNumber("line_number"); 049 050 private final String propertyName; 051 052 private Properties(String propertyName) { 053 this.propertyName = propertyName; 054 } 055 056 public String getPropertyName() { 057 return propertyName; 058 } 059 060 public String toString() { 061 return propertyName; 062 } 063 064 public String toUpper() { 065 return propertyName.toUpperCase(); 066 } 067 068 public static Properties of(String value) { 069 if(value==null) { 070 throw new NullPointerException("Argument value must not be null!"); 071 } 072 return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new); 073 } 074 }; 075 076 @JsonProperty("code") 077 @JacksonXmlProperty(localName = "code") 078 @XmlElement(name = "code") 079 private String code = null; 080 /** 081 * Gets or Sets category 082 */ 083 public enum CategoryEnum { 084 FORMAT("format"), 085 086 LOGICAL("logical"), 087 088 CROSS_CHECK("cross_check"); 089 090 private String value; 091 092 CategoryEnum(String value) { 093 this.value = value; 094 } 095 096 @JsonValue 097 public String getValue() { 098 return value; 099 } 100 101 @Override 102 public String toString() { 103 return String.valueOf(value); 104 } 105 106 @JsonCreator 107 public static CategoryEnum fromValue(String text) { 108 for (CategoryEnum b : CategoryEnum.values()) { 109 if (String.valueOf(b.value).equals(text)) { 110 return b; 111 } 112 } 113 return null; 114 } 115 } 116 117 @JsonProperty("category") 118 @JacksonXmlProperty(localName = "category") 119 @XmlElement(name = "category") 120 private CategoryEnum category = CategoryEnum.FORMAT; 121 /** 122 * Gets or Sets messageType 123 */ 124 public enum MessageTypeEnum { 125 ERROR("error"), 126 127 WARN("warn"), 128 129 INFO("info"); 130 131 private String value; 132 133 MessageTypeEnum(String value) { 134 this.value = value; 135 } 136 137 @JsonValue 138 public String getValue() { 139 return value; 140 } 141 142 @Override 143 public String toString() { 144 return String.valueOf(value); 145 } 146 147 @JsonCreator 148 public static MessageTypeEnum fromValue(String text) { 149 for (MessageTypeEnum b : MessageTypeEnum.values()) { 150 if (String.valueOf(b.value).equals(text)) { 151 return b; 152 } 153 } 154 return null; 155 } 156 } 157 158 @JsonProperty("message_type") 159 @JacksonXmlProperty(localName = "message_type") 160 @XmlElement(name = "message_type") 161 private MessageTypeEnum messageType = MessageTypeEnum.INFO; 162 @JsonProperty("message") 163 @JacksonXmlProperty(localName = "message") 164 @XmlElement(name = "message") 165 private String message = null; 166 @JsonProperty("line_number") 167 @JacksonXmlProperty(localName = "line_number") 168 @XmlElement(name = "line_number") 169 private Long lineNumber = null; 170 171 /** 172 * Builder method for code. 173 * 174 * @see ValidationMessage#setCode ValidationMessage#setCode for specification examples 175 * @see ValidationMessage#getCode ValidationMessage#getCode for validation constraints 176 * @param code a {@code String} parameter. 177 * @return ValidationMessage 178 **/ 179 public ValidationMessage code(String code) { 180 this.code = code; 181 return this; 182 } 183 184 /** 185 * <p>Get code.</p> 186 * 187 * @return code 188 **/ 189 @NotNull 190 @ApiModelProperty(required = true, value = "") 191 public String getCode() { 192 return code; 193 } 194 195 /** 196 * Set code. 197 * 198 * 199 * 200 * @see #getCode ValidationMessage#getCode for validation constraints 201 * @param code a {@code String} parameter. 202 **/ 203 public void setCode(String code) { 204 this.code = code; 205 } 206 207 208 /** 209 * Builder method for category. 210 * 211 * @see ValidationMessage#setCategory ValidationMessage#setCategory for specification examples 212 * @see ValidationMessage#getCategory ValidationMessage#getCategory for validation constraints 213 * @param category a {@code CategoryEnum} parameter. 214 * @return ValidationMessage 215 **/ 216 public ValidationMessage category(CategoryEnum category) { 217 this.category = category; 218 return this; 219 } 220 221 /** 222 * <p>Get category.</p> 223 * 224 * @return category 225 **/ 226 @NotNull 227 @ApiModelProperty(required = true, value = "") 228 public CategoryEnum getCategory() { 229 return category; 230 } 231 232 /** 233 * Set category. 234 * 235 * 236 * 237 * @see #getCategory ValidationMessage#getCategory for validation constraints 238 * @param category a {@code CategoryEnum} parameter. 239 **/ 240 public void setCategory(CategoryEnum category) { 241 this.category = category; 242 } 243 244 245 /** 246 * Builder method for messageType. 247 * 248 * @see ValidationMessage#setMessageType ValidationMessage#setMessageType for specification examples 249 * @see ValidationMessage#getMessageType ValidationMessage#getMessageType for validation constraints 250 * @param messageType a {@code MessageTypeEnum} parameter. 251 * @return ValidationMessage 252 **/ 253 public ValidationMessage messageType(MessageTypeEnum messageType) { 254 this.messageType = messageType; 255 return this; 256 } 257 258 /** 259 * <p>Get messageType.</p> 260 * 261 * @return messageType 262 **/ 263 @ApiModelProperty(value = "") 264 public MessageTypeEnum getMessageType() { 265 return messageType; 266 } 267 268 /** 269 * Set messageType. 270 * 271 * 272 * 273 * @see #getMessageType ValidationMessage#getMessageType for validation constraints 274 * @param messageType a {@code MessageTypeEnum} parameter. 275 **/ 276 public void setMessageType(MessageTypeEnum messageType) { 277 this.messageType = messageType; 278 } 279 280 281 /** 282 * Builder method for message. 283 * 284 * @see ValidationMessage#setMessage ValidationMessage#setMessage for specification examples 285 * @see ValidationMessage#getMessage ValidationMessage#getMessage for validation constraints 286 * @param message a {@code String} parameter. 287 * @return ValidationMessage 288 **/ 289 public ValidationMessage message(String message) { 290 this.message = message; 291 return this; 292 } 293 294 /** 295 * <p>Get message.</p> 296 * 297 * @return message 298 **/ 299 @NotNull 300 @ApiModelProperty(required = true, value = "") 301 public String getMessage() { 302 return message; 303 } 304 305 /** 306 * Set message. 307 * 308 * 309 * 310 * @see #getMessage ValidationMessage#getMessage for validation constraints 311 * @param message a {@code String} parameter. 312 **/ 313 public void setMessage(String message) { 314 this.message = message; 315 } 316 317 318 /** 319 * Builder method for lineNumber. 320 * 321 * @see ValidationMessage#setLineNumber ValidationMessage#setLineNumber for specification examples 322 * @see ValidationMessage#getLineNumber ValidationMessage#getLineNumber for validation constraints 323 * @param lineNumber a {@code Long} parameter. 324 * @return ValidationMessage 325 **/ 326 public ValidationMessage lineNumber(Long lineNumber) { 327 this.lineNumber = lineNumber; 328 return this; 329 } 330 331 /** 332 * <p>Get lineNumber.</p> 333 * 334 * @return lineNumber 335 **/ 336 @ApiModelProperty(value = "") 337 public Long getLineNumber() { 338 return lineNumber; 339 } 340 341 /** 342 * Set lineNumber. 343 * 344 * 345 * 346 * @see #getLineNumber ValidationMessage#getLineNumber for validation constraints 347 * @param lineNumber a {@code Long} parameter. 348 **/ 349 public void setLineNumber(Long lineNumber) { 350 this.lineNumber = lineNumber; 351 } 352 353 354 @Override 355 public boolean equals(java.lang.Object o) { 356 if (this == o) { 357 return true; 358 } 359 if (o == null || getClass() != o.getClass()) { 360 return false; 361 } 362 ValidationMessage validationMessage = (ValidationMessage) o; 363 return Objects.equals(this.code, validationMessage.code) && 364 Objects.equals(this.category, validationMessage.category) && 365 Objects.equals(this.messageType, validationMessage.messageType) && 366 Objects.equals(this.message, validationMessage.message) && 367 Objects.equals(this.lineNumber, validationMessage.lineNumber); 368 } 369 370 @Override 371 public int hashCode() { 372 return Objects.hash(code, category, messageType, message, lineNumber); 373 } 374 375 376 @Override 377 public String toString() { 378 StringBuilder sb = new StringBuilder(); 379 sb.append("class ValidationMessage {\n"); 380 381 sb.append(" code: ").append(toIndentedString(code)).append("\n"); 382 sb.append(" category: ").append(toIndentedString(category)).append("\n"); 383 sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); 384 sb.append(" message: ").append(toIndentedString(message)).append("\n"); 385 sb.append(" lineNumber: ").append(toIndentedString(lineNumber)).append("\n"); 386 sb.append("}"); 387 return sb.toString(); 388 } 389 390 /** 391 * Convert the given object to string with each line indented by 4 spaces 392 * (except the first line). 393 */ 394 private String toIndentedString(java.lang.Object o) { 395 if (o == null) { 396 return "null"; 397 } 398 return o.toString().replace("\n", "\n "); 399 } 400 401} 402