Package play.data.validation
Class ValidationError
- Object
-
- play.data.validation.ValidationError
-
public class ValidationError extends Object
A form validation error.
-
-
Constructor Summary
Constructors Constructor Description ValidationError(String key, String message)
Constructs a newValidationError
.ValidationError(String key, String message, List<Object> arguments)
Constructs a newValidationError
.ValidationError(String key, List<String> messages, List<Object> arguments)
Constructs a newValidationError
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Object>
arguments()
Returns the error arguments.String
format(Messages messagesObj)
Returns the formatted error message (message + arguments) in the given Messages.String
key()
Returns the error key.String
message()
Returns the error message.List<String>
messages()
Returns the error messages.String
toString()
-
-
-
Constructor Detail
-
ValidationError
public ValidationError(String key, String message)
Constructs a newValidationError
.- Parameters:
key
- the error keymessage
- the error message
-
ValidationError
public ValidationError(String key, String message, List<Object> arguments)
Constructs a newValidationError
.- Parameters:
key
- the error keymessage
- the error messagearguments
- 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.
-
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).
-
-