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 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 * The contact’s name, affiliation and e-mail. Several contacts can be given by indicating the number in the square brackets after "contact". A contact has to be supplied in the format [first name] [initials] [last name]. 032 033 * 034 * 035 * <p>mzTab-M specification example(s):</p> 036 * <pre><code>MTD contact[1]-name James D. Watson 037MTD contact[1]-affiliation Cambridge University, UK 038MTD contact[1]-email watson@cam.ac.uk 039MTD contact[2]-name Francis Crick 040MTD contact[2]-affiliation Cambridge University, UK 041MTD contact[2]-email crick@cam.ac.uk 042</code></pre> 043 * 044 * 045 */ 046@ApiModel(description = "The contact’s name, affiliation and e-mail. Several contacts can be given by indicating the number in the square brackets after \"contact\". A contact has to be supplied in the format [first name] [initials] [last name]. ") 047@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-08-07T11:09:24.487+02:00") 048@XmlRootElement(name = "Contact") 049@XmlAccessorType(XmlAccessType.FIELD) 050@JacksonXmlRootElement(localName = "Contact") 051public class Contact extends IndexedElement { 052 053 /** 054 * Property enumeration for Contact. 055 */ 056 public static enum Properties { 057 name("name"), 058 affiliation("affiliation"), 059 email("email"); 060 061 private final String propertyName; 062 063 private Properties(String propertyName) { 064 this.propertyName = propertyName; 065 } 066 067 public String getPropertyName() { 068 return propertyName; 069 } 070 071 public String toString() { 072 return propertyName; 073 } 074 075 public String toUpper() { 076 return propertyName.toUpperCase(); 077 } 078 079 public static Properties of(String value) { 080 if(value==null) { 081 throw new NullPointerException("Argument value must not be null!"); 082 } 083 return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new); 084 } 085 }; 086 087 @JsonProperty("name") 088 @JacksonXmlProperty(localName = "name") 089 @XmlElement(name = "name") 090 private String name = null; 091 @JsonProperty("affiliation") 092 @JacksonXmlProperty(localName = "affiliation") 093 @XmlElement(name = "affiliation") 094 private String affiliation = null; 095 @JsonProperty("email") 096 @JacksonXmlProperty(localName = "email") 097 @XmlElement(name = "email") 098 private String email = null; 099 100 @Override 101 public Contact id(Integer id) { 102 super.setId(id); 103 return this; 104 } 105 106 @Override 107 public Contact elementType(String elementType) { 108 super.setElementType(elementType); 109 return this; 110 } 111 112 /** 113 * Builder method for name. 114 * 115 * @see Contact#setName Contact#setName for specification examples 116 * @see Contact#getName Contact#getName for validation constraints 117 * @param name a {@code String} parameter. 118 * @return Contact 119 **/ 120 public Contact name(String name) { 121 this.name = name; 122 return this; 123 } 124 125 /** 126 * The contact's name. 127 * 128 * @return name 129 **/ 130 @ApiModelProperty(value = "The contact's name.") 131 public String getName() { 132 return name; 133 } 134 135 /** 136 * Set name. 137 * 138 * 139 * 140 * @see #getName Contact#getName for validation constraints 141 * @param name a {@code String} parameter. 142 **/ 143 public void setName(String name) { 144 this.name = name; 145 } 146 147 148 /** 149 * Builder method for affiliation. 150 * 151 * @see Contact#setAffiliation Contact#setAffiliation for specification examples 152 * @see Contact#getAffiliation Contact#getAffiliation for validation constraints 153 * @param affiliation a {@code String} parameter. 154 * @return Contact 155 **/ 156 public Contact affiliation(String affiliation) { 157 this.affiliation = affiliation; 158 return this; 159 } 160 161 /** 162 * The contact's affiliation. 163 * 164 * @return affiliation 165 **/ 166 @ApiModelProperty(value = "The contact's affiliation.") 167 public String getAffiliation() { 168 return affiliation; 169 } 170 171 /** 172 * Set affiliation. 173 * 174 * 175 * 176 * @see #getAffiliation Contact#getAffiliation for validation constraints 177 * @param affiliation a {@code String} parameter. 178 **/ 179 public void setAffiliation(String affiliation) { 180 this.affiliation = affiliation; 181 } 182 183 184 /** 185 * Builder method for email. 186 * 187 * @see Contact#setEmail Contact#setEmail for specification examples 188 * @see Contact#getEmail Contact#getEmail for validation constraints 189 * @param email a {@code String} parameter. 190 * @return Contact 191 **/ 192 public Contact email(String email) { 193 this.email = email; 194 return this; 195 } 196 197 /** 198 * The contact's e-mail address. 199 * 200 * @return email 201 **/ 202 @Pattern(regexp="^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$") @ApiModelProperty(value = "The contact's e-mail address.") 203 public String getEmail() { 204 return email; 205 } 206 207 /** 208 * Set email. 209 * 210 * 211 * 212 * @see #getEmail Contact#getEmail for validation constraints 213 * @param email a {@code String} parameter. 214 **/ 215 public void setEmail(String email) { 216 this.email = email; 217 } 218 219 220 @Override 221 public boolean equals(java.lang.Object o) { 222 if (this == o) { 223 return true; 224 } 225 if (o == null || getClass() != o.getClass()) { 226 return false; 227 } 228 Contact contact = (Contact) o; 229 return Objects.equals(this.name, contact.name) && 230 Objects.equals(this.affiliation, contact.affiliation) && 231 Objects.equals(this.email, contact.email) && 232 super.equals(o); 233 } 234 235 @Override 236 public int hashCode() { 237 return Objects.hash(name, affiliation, email, super.hashCode()); 238 } 239 240 241 @Override 242 public String toString() { 243 StringBuilder sb = new StringBuilder(); 244 sb.append("class Contact {\n"); 245 sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 246 sb.append(" name: ").append(toIndentedString(name)).append("\n"); 247 sb.append(" affiliation: ").append(toIndentedString(affiliation)).append("\n"); 248 sb.append(" email: ").append(toIndentedString(email)).append("\n"); 249 sb.append("}"); 250 return sb.toString(); 251 } 252 253 /** 254 * Convert the given object to string with each line indented by 4 spaces 255 * (except the first line). 256 */ 257 private String toIndentedString(java.lang.Object o) { 258 if (o == null) { 259 return "null"; 260 } 261 return o.toString().replace("\n", "\n "); 262 } 263 264} 265