package org.ovirt.engine.ui.uicommonweb.validation;

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

@SuppressWarnings("unused")
public final class ValidationResult {
    private boolean privateSuccess;

    public boolean getSuccess() {
        return privateSuccess;
    }

    public void setSuccess(boolean value) {
        privateSuccess = value;
    }

    private List<String> privateReasons;

    public List<String> getReasons() {
        return privateReasons;
    }

    public void setReasons(List<String> value) {
        privateReasons = value;
    }

    public ValidationResult() {
        this(true, new ArrayList<String>(0));
    }

    public ValidationResult(boolean success, List<String> reasons) {
        setSuccess(success);
        setReasons(reasons);
    }

    public static ValidationResult ok() {
        return new ValidationResult();
    }

    public static ValidationResult fail(String... reasons) {
        return new ValidationResult(false, Arrays.asList(reasons));
    }

    @Override
    public String toString() {
        return "ValidationResult{" + //$NON-NLS-1$
                "success=" + privateSuccess + //$NON-NLS-1$
                ", reasons=" + privateReasons + //$NON-NLS-1$
                "}"; //$NON-NLS-1$
    }
}

@@ -121,16 +121,42 @@
 il.List;
+%0Aimport java.util.Objects;
 %0A%0A@Suppr
@@ -1315,11 +1315,524 @@
 1$%0A    %7D
+%0A%0A    @Override%0A    public int hashCode() %7B%0A        return Objects.hash(privateSuccess, privateReasons);%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) %7B%0A            return true;%0A        %7D%0A        if (o == null %7C%7C getClass() != o.getClass()) %7B%0A            return false;%0A        %7D%0A        ValidationResult that = (ValidationResult) o;%0A        return Objects.equals(privateSuccess, that.privateSuccess)%0A                && Objects.equals(privateReasons, that.privateReasons);%0A    %7D
 %0A%7D%0A

Introduce isEqual and hashCode methods of ValidationResult