package com.infoclinika.pdx.projection;

import com.infoclinika.pdx.domain.sample.SampleType;

import java.util.Objects;

/**
 * DTO for genomic feature summary.
 */
public class GenomicFeatureSummary {
    private String genomicFeature;
    private SampleType model;
    private String primarySite;
    private double value;

    public GenomicFeatureSummary() {
    }

    /**
     * Initializes all fields.
     */
    public GenomicFeatureSummary(String genomicFeature, SampleType model, String primarySite, double value) {
        this.genomicFeature = genomicFeature;
        this.model = model;
        this.primarySite = primarySite;
        this.value = value;
    }

    public String getGenomicFeature() {
        return genomicFeature;
    }

    public void setGenomicFeature(String genomicFeature) {
        this.genomicFeature = genomicFeature;
    }

    public SampleType getModel() {
        return model;
    }

    public void setModel(SampleType model) {
        this.model = model;
    }

    public String getPrimarySite() {
        return primarySite;
    }

    public void setPrimarySite(String primarySite) {
        this.primarySite = primarySite;
    }

    public double getValue() {
        return value;
    }

    public void setValue(double value) {
        this.value = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final GenomicFeatureSummary that = (GenomicFeatureSummary) o;
        return Double.compare(that.getValue(), getValue()) == 0
               && Objects.equals(getGenomicFeature(), that.getGenomicFeature())
               && getModel() == that.getModel()
               && Objects.equals(getPrimarySite(), that.getPrimarySite());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getGenomicFeature(), getModel(), getPrimarySite(), getValue());
    }

    @Override
    public String toString() {
        return "GenomicFeatureSummary{"
               + "genomicFeature='" + genomicFeature + '\''
               + ", model=" + model
               + ", primarySite='" + primarySite + '\''
               + ", value=" + value
               + '}';
    }
}
