<filename>efluid-datagate-app/src/main/java/fr/uem/efluid/services/types/DiffSummaryForOneTable.java
package fr.uem.efluid.services.types;

import fr.uem.efluid.model.entities.IndexAction;

import java.util.Collection;

/**
 * Details from a diff for a specified table, with count of identified changes.
 * For display in diff, merge, revert and details screens
 *
 * @author elecomte
 * @version 1
 * @since v3.1.17
 */
public class DiffSummaryForOneTable extends DiffSummary {

    private final DictionaryEntrySummary dict;

    private DiffSummaryForOneTable(
            DictionaryEntrySummary dict,
            IndexAction.IndexActionCount counts) {
        super();
        this.dict = dict;
        setCounts(counts);
    }

    public int getTotal() {
        return this.getCounts().total();
    }

    public DictionaryEntrySummary getDict() {
        return this.dict;
    }

    public static DiffSummaryForOneTable forCount(DictionaryEntrySummary dict, IndexAction.IndexActionCount count) {
        return new DiffSummaryForOneTable(dict, count);
    }
}
