public interface ValidationResult extends Iterable<javax.validation.ConstraintViolation<?>>
Describes the validation result of all resource fields and resource
method parameters which are annotated with Valid
.
Controller methods which declare a parameter of this type will be executed even if the validation for fields and method parameters fails.
Modifier and Type | Method and Description |
---|---|
Set<javax.validation.ConstraintViolation<?>> |
getAllViolations()
Returns an immutable set of all constraint violations detected.
|
javax.validation.ConstraintViolation<?> |
getViolation(String propertyPath)
Returns a single constraint violation detected for a property
specified by the given property path.
|
int |
getViolationCount()
Returns the total number of constraint violations detected.
|
Set<javax.validation.ConstraintViolation<?>> |
getViolations(String propertyPath)
Returns an immutable set of all constraint violations detected
for a property specified by the given property path.
|
boolean |
isFailed()
Returns
true if there is at least one constraint violation. |
forEach, iterator, spliterator
boolean isFailed()
true
if there is at least one constraint violation.
Same as checking whether getViolationCount()
is greater than zero.true
if there is at least one constraint violation.int getViolationCount()
getAllViolations().size()
.Set<javax.validation.ConstraintViolation<?>> getAllViolations()
Set<javax.validation.ConstraintViolation<?>> getViolations(String propertyPath)
propertyPath
- The property path (e.g. person.age
)getViolation(String)
javax.validation.ConstraintViolation<?> getViolation(String propertyPath)
null
if no violation was detected.propertyPath
- The property path (e.g. person.age
)null
if there are no violations.Copyright © 2015 Oracle Corporation. All rights reserved.