package org.opencb.biodata.models.clinical.qc;

import java.util.LinkedHashMap;
import java.util.Map;

public class RelatednessScore {
    // Pair of samples
    private String sampleId1;
    private String sampleId2;

    // Reported relationship according to pedigree
    private String reportedRelationship;

    // Inferred relationship according to relatedness scores
    private String inferredRelationship;

    // Scores depending on the relatedness method
    private Map<String, Object> values;

    public RelatednessScore() {
        this("", "", "", "", new LinkedHashMap<>());
    }

    @Deprecated
    public RelatednessScore(String sampleId1, String sampleId2, String inferredRelationship, Map<String, Object> values) {
        this(sampleId1, sampleId2, "", inferredRelationship, values);
    }

    public RelatednessScore(String sampleId1, String sampleId2, String reportedRelationship, String inferredRelationship,
                            Map<String, Object> values) {
        this.sampleId1 = sampleId1;
        this.sampleId2 = sampleId2;
        this.reportedRelationship = reportedRelationship;
        this.inferredRelationship = inferredRelationship;
        this.values = values;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("RelatednessScore{");
        sb.append("sampleId1='").append(sampleId1).append('\'');
        sb.append(", sampleId2='").append(sampleId2).append('\'');
        sb.append(", reportedRelationship='").append(reportedRelationship).append('\'');
        sb.append(", inferredRelationship='").append(inferredRelationship).append('\'');
        sb.append(", values=").append(values);
        sb.append('}');
        return sb.toString();
    }

    public String getSampleId1() {
        return sampleId1;
    }

    public RelatednessScore setSampleId1(String sampleId1) {
        this.sampleId1 = sampleId1;
        return this;
    }

    public String getSampleId2() {
        return sampleId2;
    }

    public RelatednessScore setSampleId2(String sampleId2) {
        this.sampleId2 = sampleId2;
        return this;
    }

    public String getReportedRelationship() {
        return reportedRelationship;
    }

    public RelatednessScore setReportedRelationship(String reportedRelationship) {
        this.reportedRelationship = reportedRelationship;
        return this;
    }

    public String getInferredRelationship() {
        return inferredRelationship;
    }

    public RelatednessScore setInferredRelationship(String inferredRelationship) {
        this.inferredRelationship = inferredRelationship;
        return this;
    }

    public Map<String, Object> getValues() {
        return values;
    }

    public RelatednessScore setValues(Map<String, Object> values) {
        this.values = values;
        return this;
    }
}

@@ -404,24 +404,74 @@
 ationship;%0A%0A
+    // Validation%0A    private String validation;%0A%0A
     // Score
@@ -609,16 +609,20 @@
  %22%22, %22%22,
+ %22%22,
  new Lin
@@ -844,16 +844,20 @@
 ionship,
+ %22%22,
  values)
@@ -986,16 +986,35 @@
 ionship,
+ String validation,
 %0A       
@@ -1244,32 +1244,70 @@
 edRelationship;%0A
+        this.validation = validation;%0A
         this.val
@@ -1747,32 +1747,101 @@
 ).append('%5C'');%0A
+        sb.append(%22, validation='%22).append(validation).append('%5C'');%0A
         sb.appen
@@ -2828,32 +2828,231 @@
 rn this;%0A    %7D%0A%0A
+    public String getValidation() %7B%0A        return validation;%0A    %7D%0A%0A    public RelatednessScore setValidation(String validation) %7B%0A        this.validation = validation;%0A        return this;%0A    %7D%0A%0A
     public Map%3CS

add the field 'validation' to the RelatednesScore data model, #TASK-2215