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 * Error 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 = "Error") 036@XmlAccessorType(XmlAccessType.FIELD) 037@JacksonXmlRootElement(localName = "Error") 038public class Error { 039 040 /** 041 * Property enumeration for Error. 042 */ 043 public static enum Properties { 044 code("code"), 045 message("message"); 046 047 private final String propertyName; 048 049 private Properties(String propertyName) { 050 this.propertyName = propertyName; 051 } 052 053 public String getPropertyName() { 054 return propertyName; 055 } 056 057 public String toString() { 058 return propertyName; 059 } 060 061 public String toUpper() { 062 return propertyName.toUpperCase(); 063 } 064 065 public static Properties of(String value) { 066 if(value==null) { 067 throw new NullPointerException("Argument value must not be null!"); 068 } 069 return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new); 070 } 071 }; 072 073 @JsonProperty("code") 074 @JacksonXmlProperty(localName = "code") 075 @XmlElement(name = "code") 076 private Integer code = null; 077 @JsonProperty("message") 078 @JacksonXmlProperty(localName = "message") 079 @XmlElement(name = "message") 080 private String message = null; 081 082 /** 083 * Builder method for code. 084 * 085 * @see Error#setCode Error#setCode for specification examples 086 * @see Error#getCode Error#getCode for validation constraints 087 * @param code a {@code Integer} parameter. 088 * @return Error 089 **/ 090 public Error code(Integer code) { 091 this.code = code; 092 return this; 093 } 094 095 /** 096 * <p>Get code.</p> 097 * 098 * @return code 099 **/ 100 @NotNull 101 @ApiModelProperty(required = true, value = "") 102 public Integer getCode() { 103 return code; 104 } 105 106 /** 107 * Set code. 108 * 109 * 110 * 111 * @see #getCode Error#getCode for validation constraints 112 * @param code a {@code Integer} parameter. 113 **/ 114 public void setCode(Integer code) { 115 this.code = code; 116 } 117 118 119 /** 120 * Builder method for message. 121 * 122 * @see Error#setMessage Error#setMessage for specification examples 123 * @see Error#getMessage Error#getMessage for validation constraints 124 * @param message a {@code String} parameter. 125 * @return Error 126 **/ 127 public Error message(String message) { 128 this.message = message; 129 return this; 130 } 131 132 /** 133 * <p>Get message.</p> 134 * 135 * @return message 136 **/ 137 @NotNull 138 @ApiModelProperty(required = true, value = "") 139 public String getMessage() { 140 return message; 141 } 142 143 /** 144 * Set message. 145 * 146 * 147 * 148 * @see #getMessage Error#getMessage for validation constraints 149 * @param message a {@code String} parameter. 150 **/ 151 public void setMessage(String message) { 152 this.message = message; 153 } 154 155 156 @Override 157 public boolean equals(java.lang.Object o) { 158 if (this == o) { 159 return true; 160 } 161 if (o == null || getClass() != o.getClass()) { 162 return false; 163 } 164 Error error = (Error) o; 165 return Objects.equals(this.code, error.code) && 166 Objects.equals(this.message, error.message); 167 } 168 169 @Override 170 public int hashCode() { 171 return Objects.hash(code, message); 172 } 173 174 175 @Override 176 public String toString() { 177 StringBuilder sb = new StringBuilder(); 178 sb.append("class Error {\n"); 179 180 sb.append(" code: ").append(toIndentedString(code)).append("\n"); 181 sb.append(" message: ").append(toIndentedString(message)).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