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