package uk.ac.ebi.spot.goci.curation.builder;

import uk.ac.ebi.spot.goci.model.Association;
import uk.ac.ebi.spot.goci.model.DiseaseTrait;
import uk.ac.ebi.spot.goci.model.EfoTrait;
import uk.ac.ebi.spot.goci.model.Ethnicity;
import uk.ac.ebi.spot.goci.model.Housekeeping;
import uk.ac.ebi.spot.goci.model.Platform;
import uk.ac.ebi.spot.goci.model.Study;

import java.util.Collection;
import java.util.Date;

/**
 * Created by emma on 12/02/2016.
 *
 * @author emma
 *         <p>
 *         Study builder used in testing
 */
public class StudyBuilder {

    private Study study = new Study();

    public StudyBuilder setId(Long id) {
        study.setId(id);
        return this;
    }

    public StudyBuilder setAuthor(String author) {
        study.setAuthor(author);
        return this;
    }

    public StudyBuilder setPublicationDate(Date publicationDate) {
        study.setPublicationDate(publicationDate);
        return this;
    }

    public StudyBuilder setPublication(String publication) {
        study.setPublication(publication);
        return this;
    }

    public StudyBuilder setTitle(String title) {
        study.setTitle(title);
        return this;
    }

    public StudyBuilder setInitialSampleSize(String initialSampleSize) {
        study.setInitialSampleSize(initialSampleSize);
        return this;
    }

    public StudyBuilder setReplicateSampleSize(String replicateSampleSize) {
        study.setReplicateSampleSize(replicateSampleSize);
        return this;
    }

    public StudyBuilder setPubmedId(String pubmedId) {
        study.setPubmedId(pubmedId);
        return this;
    }

    public StudyBuilder setCnv(Boolean cnv) {
        study.setCnv(cnv);
        return this;
    }

    public StudyBuilder setGxe(Boolean gxe) {
        study.setGxe(gxe);
        return this;
    }

    public StudyBuilder setGxg(Boolean gxg) {
        study.setGxg(gxg);
        return this;
    }

    public StudyBuilder setGenomewideArray(Boolean genomewideArray) {
        study.setGenomewideArray(genomewideArray);
        return this;
    }

    public StudyBuilder setTargetedArray(Boolean targetedArray) {
        study.setTargetedArray(targetedArray);
        return this;
    }

    public StudyBuilder setDiseaseTrait(DiseaseTrait diseaseTrait) {
        study.setDiseaseTrait(diseaseTrait);
        return this;
    }

    public StudyBuilder setEfoTraits(Collection<EfoTrait> efoTraits) {
        study.setEfoTraits(efoTraits);
        return this;
    }

//    public StudyBuilder setSingleNucleotidePolymorphisms(Collection<SingleNucleotidePolymorphism> singleNucleotidePolymorphisms) {
//        study.setSingleNucleotidePolymorphisms(singleNucleotidePolymorphisms);
//        return this;
//    }

    public StudyBuilder setEthnicities(Collection<Ethnicity> ethnicities) {
        study.setEthnicities(ethnicities);
        return this;
    }

    public StudyBuilder setHousekeeping(Housekeeping housekeeping) {
        study.setHousekeeping(housekeeping);
        return this;
    }

    public StudyBuilder setAssociations(Collection<Association> associations){
        study.setAssociations(associations);
        return this;
    }

    public StudyBuilder setPooled(Boolean pooled){
        study.setPooled(pooled);
        return this;
    }

    public StudyBuilder setSnpCount(Integer snpCount){
        study.setSnpCount(snpCount);
        return this;
    }

    public StudyBuilder setQualifer(String qualifer){
        study.setQualifier(qualifer);
        return this;
    }

    public StudyBuilder setImputed(Boolean imputed){
        study.setImputed(imputed);
        return this;
    }

    public StudyBuilder setStudyDesignComment(String studyDesignComment){
        study.setStudyDesignComment(studyDesignComment);
        return this;
    }

    public StudyBuilder setPlatforms(Collection<Platform> platforms){
        study.setPlatforms(platforms);
        return this;
    }

    public Study build() {
        return study;
    }
}
@@ -220,16 +220,56 @@
 nicity;%0A
+import uk.ac.ebi.spot.goci.model.Event;%0A
 import u
@@ -2539,254 +2539,8 @@
  %7D%0A%0A
-//    public StudyBuilder setSingleNucleotidePolymorphisms(Collection%3CSingleNucleotidePolymorphism%3E singleNucleotidePolymorphisms) %7B%0A//        study.setSingleNucleotidePolymorphisms(singleNucleotidePolymorphisms);%0A//        return this;%0A//    %7D%0A%0A
     
@@ -2901,16 +2901,17 @@
 iations)
+ 
 %7B%0A      
@@ -3026,16 +3026,17 @@
  pooled)
+ 
 %7B%0A      
@@ -3143,16 +3143,17 @@
 npCount)
+ 
 %7B%0A      
@@ -3263,16 +3263,17 @@
 ualifer)
+ 
 %7B%0A      
@@ -3383,16 +3383,17 @@
 imputed)
+ 
 %7B%0A      
@@ -3521,16 +3521,17 @@
 Comment)
+ 
 %7B%0A      
@@ -3677,16 +3677,17 @@
 atforms)
+ 
 %7B%0A      
@@ -3739,32 +3739,155 @@
 rn this;%0A    %7D%0A%0A
+    public StudyBuilder setEvents(Collection%3CEvent%3E events) %7B%0A        study.setEvents(events);%0A        return this;%0A    %7D%0A%0A
     public Study

Add event variable