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 URI pointing to the file’s source data (e.g., a MetaboLights records) or an external file with more details about the study design.
031 * 
032 *
033 * <p>mzTab-M specification example(s):</p>
034 * <pre><code>MTD       uri[1]  https://www.ebi.ac.uk/metabolights/MTBLS517
035
036MTD     external_study_uri[1]   https://www.ebi.ac.uk/metabolights/MTBLS517/files/i_Investigation.txt
037</code></pre>
038 * 
039 *
040 */
041@com.fasterxml.jackson.annotation.JsonIdentityInfo(generator = com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator.class, property = "id", scope = Uri.class)
042@ApiModel(description = "A URI pointing to the file’s source data (e.g., a MetaboLights records) or an external file with more details about the study design.")
043@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2021-01-02T19:25:37.430+01:00")
044@XmlRootElement(name = "Uri")
045@XmlAccessorType(XmlAccessType.FIELD)
046@JacksonXmlRootElement(localName = "Uri")
047public class Uri {
048
049  /**
050   * Property enumeration for Uri.
051   */
052  public static enum Properties {
053      id("id"), 
054      value("value");
055
056    private final String propertyName;
057
058    private Properties(String propertyName) {
059      this.propertyName = propertyName;
060    }
061
062    public String getPropertyName() {
063      return propertyName;
064    }
065
066    public String toString() {
067      return propertyName;
068    }
069
070    public String toUpper() {
071      return propertyName.toUpperCase();
072    }
073
074    public static Properties of(String value) {
075      if(value==null) {
076        throw new NullPointerException("Argument value must not be null!");
077      }
078      return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new);
079    }
080  };
081  
082  @JsonProperty("id")
083  @JacksonXmlProperty(localName = "id")
084  @XmlElement(name = "id")
085  private Integer id = null;
086  @JsonProperty("value")
087  @JacksonXmlProperty(localName = "value")
088  @XmlElement(name = "value")
089  private String value = null;
090
091 /**
092   * Builder method for id.
093   *
094   * @see Uri#setId Uri#setId for specification examples
095   * @see Uri#getId Uri#getId for validation constraints
096   * @param id a {@code Integer} parameter.
097   * @return Uri
098  **/
099  public Uri id(Integer id) {
100   this.id = id;
101   return this;
102  }
103
104   /**
105   * <p>Get id.</p>
106   *
107   * <p>Minimum: 1</p>
108   * @return id
109  **/
110 @Min(1)  @ApiModelProperty(value = "")
111  public Integer getId() {
112    return id;
113  }
114
115 /**
116   * Set id.
117   *
118   * 
119   * 
120   * @see #getId Uri#getId for validation constraints
121   * @param id a {@code Integer} parameter.
122  **/
123  public void setId(Integer id) {
124    this.id = id;
125  }
126
127
128 /**
129   * Builder method for value.
130   *
131   * @see Uri#setValue Uri#setValue for specification examples
132   * @see Uri#getValue Uri#getValue for validation constraints
133   * @param value a {@code String} parameter.
134   * @return Uri
135  **/
136  public Uri value(String value) {
137   this.value = value;
138   return this;
139  }
140
141   /**
142   * The URI pointing to the external resource.
143   *
144   * @return value
145  **/
146  @ApiModelProperty(value = "The URI pointing to the external resource.")
147  public String getValue() {
148    return value;
149  }
150
151 /**
152   * Set value.
153   *
154   * 
155   * 
156   * @see #getValue Uri#getValue for validation constraints
157   * @param value a {@code String} parameter.
158  **/
159  public void setValue(String value) {
160    this.value = value;
161  }
162
163
164  @Override
165  public boolean equals(java.lang.Object o) {
166    if (this == o) {
167      return true;
168    }
169    if (o == null || getClass() != o.getClass()) {
170      return false;
171    }
172    Uri uri = (Uri) o;
173    return Objects.equals(this.id, uri.id) &&
174        Objects.equals(this.value, uri.value);
175  }
176
177  @Override
178  public int hashCode() {
179    return Objects.hash(id, value);
180  }
181
182
183  @Override
184  public String toString() {
185    StringBuilder sb = new StringBuilder();
186    sb.append("class Uri {\n");
187    
188    sb.append("    id: ").append(toIndentedString(id)).append("\n");
189    sb.append("    value: ").append(toIndentedString(value)).append("\n");
190    sb.append("}");
191    return sb.toString();
192  }
193
194  /**
195   * Convert the given object to string with each line indented by 4 spaces
196   * (except the first line).
197   */
198  private String toIndentedString(java.lang.Object o) {
199    if (o == null) {
200      return "null";
201    }
202    return o.toString().replace("\n", "\n    ");
203  }
204
205}
206