package de.votian.services.dto;

import java.util.ArrayList;
import java.util.List;

public class ImportExecutionResultDto {

    private boolean success;
    private String processKey;
    private String summary;
    private int createdCount;
    private int updatedCount;
    private int deletedCount;
    private int ignoredCount;
    private List<String> messages = new ArrayList<>();

    public static ImportExecutionResultDto failure(String processKey, String summary) {
        ImportExecutionResultDto dto = new ImportExecutionResultDto();
        dto.setSuccess(false);
        dto.setProcessKey(processKey);
        dto.setSummary(summary);
        return dto;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getProcessKey() {
        return processKey;
    }

    public void setProcessKey(String processKey) {
        this.processKey = processKey;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public int getCreatedCount() {
        return createdCount;
    }

    public void setCreatedCount(int createdCount) {
        this.createdCount = createdCount;
    }

    public int getUpdatedCount() {
        return updatedCount;
    }

    public void setUpdatedCount(int updatedCount) {
        this.updatedCount = updatedCount;
    }

    public int getDeletedCount() {
        return deletedCount;
    }

    public void setDeletedCount(int deletedCount) {
        this.deletedCount = deletedCount;
    }

    public int getIgnoredCount() {
        return ignoredCount;
    }

    public void setIgnoredCount(int ignoredCount) {
        this.ignoredCount = ignoredCount;
    }

    public List<String> getMessages() {
        return messages;
    }

    public void setMessages(List<String> messages) {
        this.messages = messages != null ? new ArrayList<>(messages) : new ArrayList<>();
    }
}
