/*
 * Copyright 2015-2017 OpenCB
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.opencb.opencga.core.models.file;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by imedina on 11/09/14.
 */
public class Experiment {

    private String type;
    private String platform;
    private String manufacturer;
    private String date;
    private String lab;
    private String center;
    private String responsible;
    private String description;

    private Map<String, Object> attributes;


    public Experiment() {
    }

    public Experiment(String type, String platform, String manufacturer, String date, String lab,
                      String center, String responsible, String description) {
        this(type, platform, manufacturer, date, lab, center, responsible, description, new HashMap<>());
    }

    public Experiment(String type, String platform, String manufacturer, String date,  String lab,
                      String center, String responsible, String description, Map<String, Object> attributes) {
        this.type = type;
        this.platform = platform;
        this.manufacturer = manufacturer;
        this.date = date;
        this.lab = lab;
        this.center = center;
        this.responsible = responsible;
        this.description = description;
        this.attributes = attributes;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Experiment{");
        sb.append("type='").append(type).append('\'');
        sb.append(", platform='").append(platform).append('\'');
        sb.append(", manufacturer='").append(manufacturer).append('\'');
        sb.append(", date='").append(date).append('\'');
        sb.append(", lab='").append(lab).append('\'');
        sb.append(", center='").append(center).append('\'');
        sb.append(", responsible='").append(responsible).append('\'');
        sb.append(", description='").append(description).append('\'');
        sb.append(", attributes=").append(attributes);
        sb.append('}');
        return sb.toString();
    }

    public String getType() {
        return type;
    }

    public Experiment setType(String type) {
        this.type = type;
        return this;
    }

    public String getPlatform() {
        return platform;
    }

    public Experiment setPlatform(String platform) {
        this.platform = platform;
        return this;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public Experiment setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
        return this;
    }

    public String getDate() {
        return date;
    }

    public Experiment setDate(String date) {
        this.date = date;
        return this;
    }

    public String getLab() {
        return lab;
    }

    public Experiment setLab(String lab) {
        this.lab = lab;
        return this;
    }

    public String getCenter() {
        return center;
    }

    public Experiment setCenter(String center) {
        this.center = center;
        return this;
    }

    public String getResponsible() {
        return responsible;
    }

    public Experiment setResponsible(String responsible) {
        this.responsible = responsible;
        return this;
    }

    public String getDescription() {
        return description;
    }

    public Experiment setDescription(String description) {
        this.description = description;
        return this;
    }

    public Map<String, Object> getAttributes() {
        return attributes;
    }

    public Experiment setAttributes(Map<String, Object> attributes) {
        this.attributes = attributes;
        return this;
    }

}

@@ -754,16 +754,32 @@
 ment %7B%0A%0A
+    @Deprecated%0A
     priv
@@ -807,31 +807,109 @@
 private 
-String platform
+Technology technology;%0A    private Method method;%0A    private NucleicAcidType nucleicAcidType
 ;%0A    pr
@@ -954,20 +954,24 @@
  String 
-date
+platform
 ;%0A    pr
@@ -984,18 +984,47 @@
 String l
-ab
+ibrary;%0A    private String date
 ;%0A    pr
@@ -1040,24 +1040,48 @@
 ing center;%0A
+    private String lab;%0A
     private 
@@ -1178,16 +1178,326 @@
 butes;%0A%0A
+    enum Technology %7B%0A        SEQUENCING,%0A        MICROARRAY%0A    %7D%0A%0A    enum Method %7B%0A        WHOLE_EXOME_SEQUENCING,%0A        WHOLE_GENOME_SEQUENCING,%0A        TARGETED_DNA_SEQUENCING,%0A        AMPLICON_SEQUENCING,%0A        GENOTYPING_MICROARRAY,%0A%0A    %7D%0A%0A    enum NucleicAcidType %7B%0A        DNA,%0A        RNA%0A    %7D%0A
 %0A    pub

add some new fields to Experiment #1494