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 * 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.
032 * 
033 *
034 * <p>mzTab-M specification example(s):</p>
035 * <pre><code>MTD       uri[1]  https://www.ebi.ac.uk/metabolights/MTBLS517
036
037MTD     external_study_uri[1]   https://www.ebi.ac.uk/metabolights/MTBLS517/files/i_Investigation.txt
038</code></pre>
039 * 
040 *
041 */
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 = "2020-02-11T15:11:41.249+01:00")
044@XmlRootElement(name = "Uri")
045@XmlAccessorType(XmlAccessType.FIELD)
046@JacksonXmlRootElement(localName = "Uri")
047public class Uri extends IndexedElement {
048
049  /**
050   * Property enumeration for Uri.
051   */
052  public static enum Properties {
053      value("value");
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  @JsonProperty("value")
082  @JacksonXmlProperty(localName = "value")
083  @XmlElement(name = "value")
084  private String value = null;
085  
086  @Override
087  public Uri id(Integer id) {
088   super.setId(id);
089   return this;
090  }
091  
092  @Override
093  public Uri elementType(String elementType) {
094   super.setElementType(elementType);
095   return this;
096  }
097
098 /**
099   * Builder method for value.
100   *
101   * @see Uri#setValue Uri#setValue for specification examples
102   * @see Uri#getValue Uri#getValue for validation constraints
103   * @param value a {@code String} parameter.
104   * @return Uri
105  **/
106  public Uri value(String value) {
107   this.value = value;
108   return this;
109  }
110
111   /**
112   * The URI pointing to the external resource.
113   *
114   * @return value
115  **/
116  @ApiModelProperty(value = "The URI pointing to the external resource.")
117  public String getValue() {
118    return value;
119  }
120
121 /**
122   * Set value.
123   *
124   * 
125   * 
126   * @see #getValue Uri#getValue for validation constraints
127   * @param value a {@code String} parameter.
128  **/
129  public void setValue(String value) {
130    this.value = value;
131  }
132
133
134  @Override
135  public boolean equals(java.lang.Object o) {
136    if (this == o) {
137      return true;
138    }
139    if (o == null || getClass() != o.getClass()) {
140      return false;
141    }
142    Uri uri = (Uri) o;
143    return Objects.equals(this.value, uri.value) &&
144        super.equals(o);
145  }
146
147  @Override
148  public int hashCode() {
149    return Objects.hash(value, super.hashCode());
150  }
151
152
153  @Override
154  public String toString() {
155    StringBuilder sb = new StringBuilder();
156    sb.append("class Uri {\n");
157    sb.append("    ").append(toIndentedString(super.toString())).append("\n");
158    sb.append("    value: ").append(toIndentedString(value)).append("\n");
159    sb.append("}");
160    return sb.toString();
161  }
162
163  /**
164   * Convert the given object to string with each line indented by 4 spaces
165   * (except the first line).
166   */
167  private String toIndentedString(java.lang.Object o) {
168    if (o == null) {
169      return "null";
170    }
171    return o.toString().replace("\n", "\n    ");
172  }
173
174}
175