package com.eactive.ext.kjb.ums;

import java.util.Collections;
import java.util.Map;

public class EmailValidationResult {
    private final boolean success;
    private final Map<String, String> errors;


    public EmailValidationResult(boolean success, Map<String, String> errors) {
        this.success = success;
        this.errors = errors;
    }

    public static EmailValidationResult ok() {
        return new EmailValidationResult(true, Collections.emptyMap());
    }

    public static EmailValidationResult failed(Map<String, String> errors) {
        return new EmailValidationResult(false, errors);
    }

    public boolean isSuccess() {
        return success;
    }

    public Map<String, String> getErrors() {
        return errors;
    }

    @Override
    public String toString() {
        return "ValidationResult{" +
                "success=" + success +
                ", errors=" + errors +
                '}';
    }
}
