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 * 030 * Comment lines can be placed anywhere in an mzTab file. These lines must start with the three-letter code COM and are ignored by most parsers. Empty lines can also occur anywhere in an mzTab file and are ignored. 031 032 * 033 * 034 * <p>mzTab-M specification example(s):</p> 035 * <pre><code>COM This is a comment line 036</code></pre> 037 * 038 * 039 */ 040@ApiModel(description = "Comment lines can be placed anywhere in an mzTab file. These lines must start with the three-letter code COM and are ignored by most parsers. Empty lines can also occur anywhere in an mzTab file and are ignored. ") 041@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2021-01-02T19:26:21.550+01:00") 042@XmlRootElement(name = "Comment") 043@XmlAccessorType(XmlAccessType.FIELD) 044@JacksonXmlRootElement(localName = "Comment") 045public class Comment { 046 047 /** 048 * Property enumeration for Comment. 049 */ 050 public static enum Properties { 051 prefix("prefix"), 052 msg("msg"), 053 lineNumber("line_number"); 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 /** 082 * Gets or Sets prefix 083 */ 084 public enum PrefixEnum { 085 COM("COM"); 086 087 private String value; 088 089 PrefixEnum(String value) { 090 this.value = value; 091 } 092 093 @JsonValue 094 public String getValue() { 095 return value; 096 } 097 098 @Override 099 public String toString() { 100 return String.valueOf(value); 101 } 102 103 @JsonCreator 104 public static PrefixEnum fromValue(String text) { 105 for (PrefixEnum b : PrefixEnum.values()) { 106 if (String.valueOf(b.value).equals(text)) { 107 return b; 108 } 109 } 110 return null; 111 } 112 } 113 114 @JsonProperty("prefix") 115 @JacksonXmlProperty(localName = "prefix") 116 @XmlElement(name = "prefix") 117 private PrefixEnum prefix = PrefixEnum.COM; 118 @JsonProperty("msg") 119 @JacksonXmlProperty(localName = "msg") 120 @XmlElement(name = "msg") 121 private String msg = null; 122 @JsonProperty("line_number") 123 @JacksonXmlProperty(localName = "line_number") 124 @XmlElement(name = "line_number") 125 private Integer lineNumber = null; 126 127 /** 128 * Builder method for prefix. 129 * 130 * @see Comment#setPrefix Comment#setPrefix for specification examples 131 * @see Comment#getPrefix Comment#getPrefix for validation constraints 132 * @param prefix a {@code PrefixEnum} parameter. 133 * @return Comment 134 **/ 135 public Comment prefix(PrefixEnum prefix) { 136 this.prefix = prefix; 137 return this; 138 } 139 140 /** 141 * <p>Get prefix.</p> 142 * 143 * @return prefix 144 **/ 145 @NotNull 146 @ApiModelProperty(required = true, value = "") 147 public PrefixEnum getPrefix() { 148 return prefix; 149 } 150 151 /** 152 * Set prefix. 153 * 154 * 155 * 156 * @see #getPrefix Comment#getPrefix for validation constraints 157 * @param prefix a {@code PrefixEnum} parameter. 158 **/ 159 public void setPrefix(PrefixEnum prefix) { 160 this.prefix = prefix; 161 } 162 163 164 /** 165 * Builder method for msg. 166 * 167 * @see Comment#setMsg Comment#setMsg for specification examples 168 * @see Comment#getMsg Comment#getMsg for validation constraints 169 * @param msg a {@code String} parameter. 170 * @return Comment 171 **/ 172 public Comment msg(String msg) { 173 this.msg = msg; 174 return this; 175 } 176 177 /** 178 * <p>Get msg.</p> 179 * 180 * @return msg 181 **/ 182 @NotNull 183 @ApiModelProperty(required = true, value = "") 184 public String getMsg() { 185 return msg; 186 } 187 188 /** 189 * Set msg. 190 * 191 * 192 * 193 * @see #getMsg Comment#getMsg for validation constraints 194 * @param msg a {@code String} parameter. 195 **/ 196 public void setMsg(String msg) { 197 this.msg = msg; 198 } 199 200 201 /** 202 * Builder method for lineNumber. 203 * 204 * @see Comment#setLineNumber Comment#setLineNumber for specification examples 205 * @see Comment#getLineNumber Comment#getLineNumber for validation constraints 206 * @param lineNumber a {@code Integer} parameter. 207 * @return Comment 208 **/ 209 public Comment lineNumber(Integer lineNumber) { 210 this.lineNumber = lineNumber; 211 return this; 212 } 213 214 /** 215 * <p>Get lineNumber.</p> 216 * 217 * @return lineNumber 218 **/ 219 @ApiModelProperty(value = "") 220 public Integer getLineNumber() { 221 return lineNumber; 222 } 223 224 /** 225 * Set lineNumber. 226 * 227 * 228 * 229 * @see #getLineNumber Comment#getLineNumber for validation constraints 230 * @param lineNumber a {@code Integer} parameter. 231 **/ 232 public void setLineNumber(Integer lineNumber) { 233 this.lineNumber = lineNumber; 234 } 235 236 237 @Override 238 public boolean equals(java.lang.Object o) { 239 if (this == o) { 240 return true; 241 } 242 if (o == null || getClass() != o.getClass()) { 243 return false; 244 } 245 Comment comment = (Comment) o; 246 return Objects.equals(this.prefix, comment.prefix) && 247 Objects.equals(this.msg, comment.msg) && 248 Objects.equals(this.lineNumber, comment.lineNumber); 249 } 250 251 @Override 252 public int hashCode() { 253 return Objects.hash(prefix, msg, lineNumber); 254 } 255 256 257 @Override 258 public String toString() { 259 StringBuilder sb = new StringBuilder(); 260 sb.append("class Comment {\n"); 261 262 sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); 263 sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); 264 sb.append(" lineNumber: ").append(toIndentedString(lineNumber)).append("\n"); 265 sb.append("}"); 266 return sb.toString(); 267 } 268 269 /** 270 * Convert the given object to string with each line indented by 4 spaces 271 * (except the first line). 272 */ 273 private String toIndentedString(java.lang.Object o) { 274 if (o == null) { 275 return "null"; 276 } 277 return o.toString().replace("\n", "\n "); 278 } 279 280} 281