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.PublicationItem; 022import io.swagger.annotations.ApiModel; 023import io.swagger.annotations.ApiModelProperty; 024import java.util.ArrayList; 025import java.util.List; 026import com.fasterxml.jackson.dataformat.xml.annotation.*; 027import javax.xml.bind.annotation.*; 028import javax.validation.constraints.*; 029import javax.validation.Valid; 030import de.isas.lipidomics.mztab2.validation.constraints.*; 031/** 032 * 033 * A publication associated with this file. Several publications can be given by indicating the number in the square brackets after “publication”. PubMed ids must be prefixed by “pubmed:”, DOIs by “doi:”. Multiple identifiers MUST be separated by “|”. 034 035 * 036 * 037 * <p>mzTab-M specification example(s):</p> 038 * <pre><code>MTD publication[1] pubmed:21063943|doi:10.1007/978-1-60761-987-1_6 039MTD publication[2] pubmed:20615486|doi:10.1016/j.jprot.2010.06.008 040</code></pre> 041 * 042 * 043 */ 044@com.fasterxml.jackson.annotation.JsonIdentityInfo(generator = com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator.class, property = "id", scope = Publication.class) 045@ApiModel(description = "A publication associated with this file. Several publications can be given by indicating the number in the square brackets after “publication”. PubMed ids must be prefixed by “pubmed:”, DOIs by “doi:”. Multiple identifiers MUST be separated by “|”. ") 046@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2021-01-02T19:25:37.430+01:00") 047@XmlRootElement(name = "Publication") 048@XmlAccessorType(XmlAccessType.FIELD) 049@JacksonXmlRootElement(localName = "Publication") 050public class Publication { 051 052 /** 053 * Property enumeration for Publication. 054 */ 055 public static enum Properties { 056 id("id"), 057 publicationItems("publicationItems"); 058 059 private final String propertyName; 060 061 private Properties(String propertyName) { 062 this.propertyName = propertyName; 063 } 064 065 public String getPropertyName() { 066 return propertyName; 067 } 068 069 public String toString() { 070 return propertyName; 071 } 072 073 public String toUpper() { 074 return propertyName.toUpperCase(); 075 } 076 077 public static Properties of(String value) { 078 if(value==null) { 079 throw new NullPointerException("Argument value must not be null!"); 080 } 081 return Arrays.asList(Properties.values()).stream().filter(m -> m.propertyName.equals(value.toLowerCase())).findAny().orElseThrow(IllegalArgumentException::new); 082 } 083 }; 084 085 @JsonProperty("id") 086 @JacksonXmlProperty(localName = "id") 087 @XmlElement(name = "id") 088 private Integer id = null; 089 @JsonProperty("publicationItems") 090 // Is a container wrapped=false 091 // items.name=publicationItems items.baseName=publicationItems items.xmlName= items.xmlNamespace= 092 // items.example= items.type=PublicationItem 093 @XmlElement(name = "publicationItems") 094 private List<PublicationItem> publicationItems = new ArrayList<>(); 095 096 /** 097 * Builder method for id. 098 * 099 * @see Publication#setId Publication#setId for specification examples 100 * @see Publication#getId Publication#getId for validation constraints 101 * @param id a {@code Integer} parameter. 102 * @return Publication 103 **/ 104 public Publication id(Integer id) { 105 this.id = id; 106 return this; 107 } 108 109 /** 110 * <p>Get id.</p> 111 * 112 * <p>Minimum: 1</p> 113 * @return id 114 **/ 115 @Min(1) @ApiModelProperty(value = "") 116 public Integer getId() { 117 return id; 118 } 119 120 /** 121 * Set id. 122 * 123 * 124 * 125 * @see #getId Publication#getId for validation constraints 126 * @param id a {@code Integer} parameter. 127 **/ 128 public void setId(Integer id) { 129 this.id = id; 130 } 131 132 133 /** 134 * Builder method for publicationItems. 135 * 136 * @see Publication#setPublicationItems Publication#setPublicationItems for specification examples 137 * @see Publication#getPublicationItems Publication#getPublicationItems for validation constraints 138 * @param publicationItems a {@code List<PublicationItem>} parameter. 139 * @return Publication 140 **/ 141 public Publication publicationItems(List<PublicationItem> publicationItems) { 142 this.publicationItems = publicationItems; 143 return this; 144 } 145 146 /** 147 * Add a single publicationItemsItem to the publicationItems collection. 148 * 149 * @see Publication#getPublicationItems Publication#getPublicationItems for validation constraints 150 * @param publicationItemsItem a {@code PublicationItem} parameter. 151 * @return Publication 152 */ 153 public Publication addPublicationItemsItem(PublicationItem publicationItemsItem) { 154 this.publicationItems.add(publicationItemsItem); 155 return this; 156 } 157 158 /** 159 * The publication item ids referenced by this publication. 160 * 161 * @return publicationItems 162 **/ 163 @NotNull 164 @Valid 165 @ApiModelProperty(required = true, value = "The publication item ids referenced by this publication.") 166 public List<PublicationItem> getPublicationItems() { 167 return publicationItems; 168 } 169 170 /** 171 * Set publicationItems. 172 * 173 * 174 * 175 * @see #getPublicationItems Publication#getPublicationItems for validation constraints 176 * @param publicationItems a {@code List<PublicationItem>} parameter. 177 **/ 178 public void setPublicationItems(List<PublicationItem> publicationItems) { 179 this.publicationItems = publicationItems; 180 } 181 182 183 @Override 184 public boolean equals(java.lang.Object o) { 185 if (this == o) { 186 return true; 187 } 188 if (o == null || getClass() != o.getClass()) { 189 return false; 190 } 191 Publication publication = (Publication) o; 192 return Objects.equals(this.id, publication.id) && 193 Objects.equals(this.publicationItems, publication.publicationItems); 194 } 195 196 @Override 197 public int hashCode() { 198 return Objects.hash(id, publicationItems); 199 } 200 201 202 @Override 203 public String toString() { 204 StringBuilder sb = new StringBuilder(); 205 sb.append("class Publication {\n"); 206 207 sb.append(" id: ").append(toIndentedString(id)).append("\n"); 208 sb.append(" publicationItems: ").append(toIndentedString(publicationItems)).append("\n"); 209 sb.append("}"); 210 return sb.toString(); 211 } 212 213 /** 214 * Convert the given object to string with each line indented by 4 spaces 215 * (except the first line). 216 */ 217 private String toIndentedString(java.lang.Object o) { 218 if (o == null) { 219 return "null"; 220 } 221 return o.toString().replace("\n", "\n "); 222 } 223 224} 225