package com.infoclinika.pdx.projection;

import java.util.List;
import java.util.Objects;

/**
 * DTO for gene statistics with a list of genomic feature summaries.
 */
public class AggregateGeneStatistics {
    private String gene;
    private List<GenomicFeatureSummary> data;

    public AggregateGeneStatistics() {
    }

    /**
     * Initializes gene field.
     */
    public AggregateGeneStatistics(String gene) {
        this.gene = gene;
    }

    /**
     * Initializes all fields.
     */
    public AggregateGeneStatistics(String gene, List<GenomicFeatureSummary> data) {
        this(gene);
        this.data = data;
    }

    public String getGene() {
        return gene;
    }

    public void setGene(String gene) {
        this.gene = gene;
    }

    public List<GenomicFeatureSummary> getData() {
        return data;
    }

    public void setData(List<GenomicFeatureSummary> data) {
        this.data = data;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final AggregateGeneStatistics that = (AggregateGeneStatistics) o;
        return Objects.equals(getGene(), that.getGene())
               && Objects.equals(getData(), that.getData());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getGene(), getData());
    }

    @Override
    public String toString() {
        return "AggregateGeneStatistics{"
               + "gene='" + gene + '\''
               + ", data=" + data
               + '}';
    }
}
