package uk.ac.ebi.quickgo.geneproduct.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import uk.ac.ebi.quickgo.common.FieldType;

import java.util.List;
import java.util.Optional;

/**
 * @Author Tony Wardell
 * Date: 22/03/2016
 * Time: 14:10
 * Created with IntelliJ IDEA.
 * See http://geneontology.org/page/gene-product-information-gpi-format
 */
public class GeneProduct {

	//UniProt, RNA Central, Intact
	public String database;

	//e.g. A0A000 http://www.uniprot.org/uniprot/A0A000
	public String identifier;

	//A (unique and valid) symbol to which DB object ID is matched this field is mandatory, cardinality 1
	public String symbol;

	//name of gene or gene product this field is not mandatory, cardinality 0, 1 [white space allowed]
	public String name;

	//Gene symbol [or other text]
	public List<Synonym> synonyms;

	//A description of the type of the gene or gene product being annotated. one of the following: protein_complex;
	// protein; transcript; ncRNA; rRNA; tRNA; snRNA; snoRNA; any subtype of ncRNA in the Sequence Ontology.
	public String type;

	//taxonomic identifier(s) The NCBI taxon ID of the species encoding the gene product. this field is mandatory,
	public Taxonomy taxonomy;

	public String databaseSubset;

	//UPID
	public String referenceProteome;

	public boolean isIsoform;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	public static class Synonym implements FieldType {
		public String synonymName;
		public String synonymType;
	}

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	public static class Taxonomy implements FieldType {

		//Numeric id e.g. 35758
		public String identifier;

		//Organism name e.g. Streptomyces ghanaensis
		public String name;
	}
}

@@ -818,22 +818,21 @@
 c List%3CS
-ynonym
+tring
 %3E synony
@@ -1217,38 +1217,44 @@
 onomy;%0A%0A%09public 
+List%3C
 String
+%3E
  databaseSubset;
@@ -1330,167 +1330,8 @@
 m;%0A%0A
-%09@JsonInclude(JsonInclude.Include.NON_EMPTY)%0A%09public static class Synonym implements FieldType %7B%0A%09%09public String synonymName;%0A%09%09public String synonymType;%0A%09%7D%0A%0A
 %09@Js
@@ -1460,33 +1460,22 @@
 %09public 
-Str
 in
-g
+t
  id
-entifier
 ;%0A%0A%09%09//O
@@ -1516,16 +1516,16 @@
 naensis%0A
-
 %09%09public
@@ -1537,14 +1537,114 @@
 ng name;
+%0A%0A%09%09public Taxonomy(int identifier, String name) %7B%0A%09%09%09this.id = identifier;%0A%09%09%09this.name = name;%0A%09%09%7D
 %0A%09%7D%0A%7D%0A

Change object to match whats in the document.