
package uk.ac.ebi.atlas.utils;

import com.google.common.collect.Sets;
import uk.ac.ebi.atlas.model.experiment.ExperimentType;

import java.util.Set;
import java.util.SortedSet;

/*
I'm a useful class, just old. I show up as rows on Experiments page, and at latest experiments.
Find out why I need to be a bean, and if possible unbean me!
lastUpdate is a String that is later parsed, which you could improve.
 */
public class ExperimentInfo implements Comparable<ExperimentInfo> {

    private ExperimentType experimentType;
    private String experimentAccession;
    private String experimentDescription;
    private String lastUpdate;
    private int numberOfAssays;
    private int numberOfContrasts;
    private String species;
    private String kingdom;
    private String ensemblDB;
    private SortedSet<String> experimentalFactors = Sets.newTreeSet();
    private SortedSet<String> arrayDesigns = Sets.newTreeSet();
    private SortedSet<String> arrayDesignNames = Sets.newTreeSet();

    public ExperimentType getExperimentType() {
        return experimentType;
    }

    public void setExperimentType(ExperimentType experimentType) {
        this.experimentType = experimentType;
    }

    public String getExperimentAccession() {
        return experimentAccession;
    }

    public void setExperimentAccession(String experimentAccession) {
        this.experimentAccession = experimentAccession;
    }

    public String getExperimentDescription() {
        return experimentDescription;
    }

    public void setExperimentDescription(String experimentDescription) {
        this.experimentDescription = experimentDescription;
    }

    public int getNumberOfAssays() {
        return numberOfAssays;
    }

    public void setNumberOfAssays(int numberOfAssays) {
        this.numberOfAssays = numberOfAssays;
    }

    public int getNumberOfContrasts() {
        return numberOfContrasts;
    }

    public void setNumberOfContrasts(int numberOfContrasts) {
        this.numberOfContrasts = numberOfContrasts;
    }

    public String getSpecies() {
        return species;
    }

    public void setSpecies(String species) {
        this.species = species;
    }

    public String getKingdom() {
        return kingdom;
    }

    public void setKingdom(String kingdom) {
        this.kingdom = kingdom;
    }

    public String getEnsemblDB() {
        return ensemblDB;
    }

    public void setEnsemblDB(String ensemblDB) {
        this.ensemblDB = ensemblDB;
    }

    public SortedSet<String> getExperimentalFactors() {
        return experimentalFactors;
    }

    public void setExperimentalFactors(Set<String> experimentalFactors) {
        this.experimentalFactors = Sets.newTreeSet(experimentalFactors);
    }

    public SortedSet<String> getArrayDesigns() {
        return arrayDesigns;
    }

    public void setArrayDesigns(Set<String> arrayDesigns) {
        this.arrayDesigns = Sets.newTreeSet(arrayDesigns);
    }

    public SortedSet<String> getArrayDesignNames() {
        return arrayDesignNames;
    }

    public void setArrayDesignNames(SortedSet<String> arrayDesignNames) {
        this.arrayDesignNames = arrayDesignNames;
    }

    @Override
    public int compareTo(ExperimentInfo o) {
        return this.experimentAccession.compareTo(o.experimentAccession);
    }

    public String getLastUpdate() {
        return lastUpdate;
    }

    public void setLastUpdate(String lastUpdate) {
        this.lastUpdate = lastUpdate;
    }
}
@@ -276,68 +276,225 @@
 ts.%0A
-Find out why I need to be a bean, and if possible unbean me!
+I am a bean so that setting properties is convenient but this could change.%0AI could have a toJson method, and then there will be no need for reflection-based serialization that we're currently%0A(and confusingly) doing.
 %0Alas
@@ -540,16 +540,51 @@
 d, which
+, if you implement a toJson method,
  you cou
@@ -594,16 +594,17 @@
 improve.
+ 
 %0A */%0Apub

Comment outlaying my future vision of how to improve ExperimentInfo