Package play.data.validation
Class Constraints.RequiredValidator
- Object
-
- play.data.validation.Constraints.Validator<Object>
-
- play.data.validation.Constraints.RequiredValidator
-
- All Implemented Interfaces:
javax.validation.ConstraintValidator<Constraints.Required,Object>
- Enclosing class:
- Constraints
public static class Constraints.RequiredValidator extends Constraints.Validator<Object> implements javax.validation.ConstraintValidator<Constraints.Required,Object>
Validator for@Required
fields.
-
-
Constructor Summary
Constructors Constructor Description RequiredValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description F.Tuple<String,Object[]>
getErrorMessageKey()
void
initialize(Constraints.Required constraintAnnotation)
boolean
isValid(Object object)
-
Methods inherited from class play.data.validation.Constraints.Validator
isValid
-
-
-
-
Field Detail
-
message
public static final String message
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(Constraints.Required constraintAnnotation)
- Specified by:
initialize
in interfacejavax.validation.ConstraintValidator<Constraints.Required,Object>
-
isValid
public boolean isValid(Object object)
- Specified by:
isValid
in classConstraints.Validator<Object>
- Parameters:
object
- the value to test.- Returns:
true
if this value is valid.
-
getErrorMessageKey
public F.Tuple<String,Object[]> getErrorMessageKey()
- Specified by:
getErrorMessageKey
in classConstraints.Validator<Object>
-
-