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 * A publication item, defined by a qualifier and a native accession, e.g. pubmed id.
031 * 
032 *
033 * 
034 *
035 */
036@ApiModel(description = "A publication item, defined by a qualifier and a native accession, e.g. pubmed id.")
037@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-08-07T11:09:24.487+02:00")
038@XmlRootElement(name = "PublicationItem")
039@XmlAccessorType(XmlAccessType.FIELD)
040@JacksonXmlRootElement(localName = "PublicationItem")
041public class PublicationItem {
042
043  /**
044   * Property enumeration for PublicationItem.
045   */
046  public static enum Properties {
047      type("type"), 
048      accession("accession");
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  /**
077   * The type qualifier of this publication item.
078   */
079  public enum TypeEnum {
080    DOI("doi"),
081    
082    PUBMED("pubmed"),
083    
084    URI("uri");
085
086    private String value;
087
088    TypeEnum(String value) {
089      this.value = value;
090    }
091
092    @JsonValue
093    public String getValue() {
094      return value;
095    }
096
097    @Override
098    public String toString() {
099      return String.valueOf(value);
100    }
101
102    @JsonCreator
103    public static TypeEnum fromValue(String text) {
104      for (TypeEnum b : TypeEnum.values()) {
105        if (String.valueOf(b.value).equals(text)) {
106          return b;
107        }
108      }
109      return null;
110    }
111  }
112
113  @JsonProperty("type")
114  @JacksonXmlProperty(localName = "type")
115  @XmlElement(name = "type")
116  private TypeEnum type = TypeEnum.DOI;
117  @JsonProperty("accession")
118  @JacksonXmlProperty(localName = "accession")
119  @XmlElement(name = "accession")
120  private String accession = null;
121
122 /**
123   * Builder method for type.
124   *
125   * @see PublicationItem#setType PublicationItem#setType for specification examples
126   * @see PublicationItem#getType PublicationItem#getType for validation constraints
127   * @param type a {@code TypeEnum} parameter.
128   * @return PublicationItem
129  **/
130  public PublicationItem type(TypeEnum type) {
131   this.type = type;
132   return this;
133  }
134
135   /**
136   * The type qualifier of this publication item.
137   *
138   * @return type
139  **/
140  @NotNull
141  @ApiModelProperty(required = true, value = "The type qualifier of this publication item.")
142  public TypeEnum getType() {
143    return type;
144  }
145
146 /**
147   * Set type.
148   *
149   * 
150   * 
151   * @see #getType PublicationItem#getType for validation constraints
152   * @param type a {@code TypeEnum} parameter.
153  **/
154  public void setType(TypeEnum type) {
155    this.type = type;
156  }
157
158
159 /**
160   * Builder method for accession.
161   *
162   * @see PublicationItem#setAccession PublicationItem#setAccession for specification examples
163   * @see PublicationItem#getAccession PublicationItem#getAccession for validation constraints
164   * @param accession a {@code String} parameter.
165   * @return PublicationItem
166  **/
167  public PublicationItem accession(String accession) {
168   this.accession = accession;
169   return this;
170  }
171
172   /**
173   * The native accession id for this publication item.
174   *
175   * @return accession
176  **/
177  @NotNull
178  @ApiModelProperty(required = true, value = "The native accession id for this publication item.")
179  public String getAccession() {
180    return accession;
181  }
182
183 /**
184   * Set accession.
185   *
186   * 
187   * 
188   * @see #getAccession PublicationItem#getAccession for validation constraints
189   * @param accession a {@code String} parameter.
190  **/
191  public void setAccession(String accession) {
192    this.accession = accession;
193  }
194
195
196  @Override
197  public boolean equals(java.lang.Object o) {
198    if (this == o) {
199      return true;
200    }
201    if (o == null || getClass() != o.getClass()) {
202      return false;
203    }
204    PublicationItem publicationItem = (PublicationItem) o;
205    return Objects.equals(this.type, publicationItem.type) &&
206        Objects.equals(this.accession, publicationItem.accession);
207  }
208
209  @Override
210  public int hashCode() {
211    return Objects.hash(type, accession);
212  }
213
214
215  @Override
216  public String toString() {
217    StringBuilder sb = new StringBuilder();
218    sb.append("class PublicationItem {\n");
219    
220    sb.append("    type: ").append(toIndentedString(type)).append("\n");
221    sb.append("    accession: ").append(toIndentedString(accession)).append("\n");
222    sb.append("}");
223    return sb.toString();
224  }
225
226  /**
227   * Convert the given object to string with each line indented by 4 spaces
228   * (except the first line).
229   */
230  private String toIndentedString(java.lang.Object o) {
231    if (o == null) {
232      return "null";
233    }
234    return o.toString().replace("\n", "\n    ");
235  }
236
237}
238