package com.github.monzou.guardman.validator.impl;

import java.io.Serializable;

import com.github.monzou.guardman.model.ValidationSeverity;
import com.github.monzou.guardman.validator.MutableValueValidator;
import com.github.monzou.guardman.validator.ValidationContext;

/**
 * AbstractMutableValueValidator
 * 
 * @param <V> the type of value to validate
 */
@SuppressWarnings("serial")
public abstract class AbstractMutableValueValidator<V> implements MutableValueValidator<V>, Serializable {

    protected ValidationSeverity severity = ValidationSeverity.ERROR;

    protected String message;

    protected Object[] params;

    /** {@inheritDoc} */
    @Override
    public boolean apply(V value, ValidationContext context) {
        if (apply(value)) {
            return true;
        }
        if (message != null) {
            context.apply(severity, message);
        } else {
            context.apply(severity, resolveMessage(value, params));
        }
        return false;
    }

    protected abstract String resolveMessage(V value, Object... params);

    /** {@inheritDoc} */
    @Override
    public MutableValueValidator<V> severity(ValidationSeverity severity) {
        this.severity = severity;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public MutableValueValidator<V> message(String message) {
        this.message = message;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public MutableValueValidator<V> params(Object... params) {
        this.params = params;
        return this;
    }

}

@@ -491,16 +491,36 @@
 able %7B%0A%0A
+    /** Severity */%0A
     prot
@@ -582,16 +582,35 @@
 ERROR;%0A%0A
+    /** Message */%0A
     prot
@@ -632,16 +632,42 @@
 ssage;%0A%0A
+    /** Message params */%0A
     prot

Fix checkstyle