Class ValidationError


  • public class ValidationError
    extends Object
    A form validation error.
    • Constructor Detail

      • ValidationError

        public ValidationError​(String key,
                               String message)
        Constructs a new ValidationError.
        Parameters:
        key - the error key
        message - the error message
      • ValidationError

        public ValidationError​(String key,
                               String message,
                               List<Object> arguments)
        Constructs a new ValidationError.
        Parameters:
        key - the error key
        message - the error message
        arguments - the error message arguments
      • ValidationError

        public ValidationError​(String key,
                               List<String> messages,
                               List<Object> arguments)
        Constructs a new ValidationError.
        Parameters:
        key - the error key
        messages - the list of error messages
        arguments - the error message arguments
    • Method Detail

      • key

        public String key()
        Returns the error key.
        Returns:
        the error key of the message.
      • message

        public String message()
        Returns the error message.
        Returns:
        the last message in the list of messages.
      • messages

        public List<String> messages()
        Returns the error messages.
        Returns:
        a list of messages.
      • arguments

        public List<Object> arguments()
        Returns the error arguments.
        Returns:
        a list of error arguments.
      • format

        public String format​(Messages messagesObj)
        Returns the formatted error message (message + arguments) in the given Messages.
        Parameters:
        messagesObj - the play.i18n.Messages object containing the language.
        Returns:
        the results of messagesObj.at(messages, arguments).