package play.data.validation;

import java.util.*;

/**
 * A form validation error.
 */
public class ValidationError {
    
    private String key;
    private String message;
    private List<Object> arguments;
    
    /**
     * Constructs a new <code>ValidationError</code>.
     *
     * @param key the error key
     * @param message the error message
     * @param arguments the error message arguments
     */
    public ValidationError(String key, String message, List<Object> arguments) {
        this.key = key;
        this.message = message;
        this.arguments = arguments;
    }
    
    /**
     * Returns the error key.
     */
    public String key() {
        return key;
    }
    
    /**
     * Returns the error message.
     */
    public String message() {
        return message;
    }

    /**
     * Returns the error arguments.
     */
    public List<Object> arguments() {
        return arguments;
    }
    
    public String toString() {
        return "ValidationError(" + key + "," + message + "," + arguments + ")";
    }
    
}
@@ -45,16 +45,65 @@
 til.*;%0A%0A
+import com.google.common.collect.ImmutableList;%0A%0A
 /**%0A * A
@@ -249,24 +249,285 @@
 %3E arguments;
+%0A%0A    /**%0A     * Constructs a new %3Ccode%3EValidationError%3C/code%3E.%0A     *%0A     * @param key the error key%0A     * @param message the error message%0A     */%0A    public ValidationError(String key, String message) %7B%0A        this(key, message, ImmutableList.of());%0A    %7D
 %0A    %0A    /*

Add a convenience constructor for ValidationError