Interface MethodValidationResult
- All Known Implementing Classes:
- HandlerMethodValidationException,- MethodValidationException
public interface MethodValidationResult
Container for method validation results with validation errors from the
 underlying library adapted to 
MessageSourceResolvables and grouped
 by method parameter as ParameterValidationResult. For method parameters
 with nested validation errors, the validation result is of type
 ParameterErrors and implements Errors.- Since:
- 6.1
- Author:
- Rossen Stoyanchev
- 
Method SummaryModifier and TypeMethodDescriptionstatic MethodValidationResultcreate(Object target, Method method, List<ParameterValidationResult> results) Factory method to create aMethodValidationResultinstance.static MethodValidationResultFactory method to create aMethodValidationResultinstance with 0 errors, suitable to use as a constant.default List<? extends MessageSourceResolvable>Return a single list with all errors from all validation results.Return all validation results.default List<ParameterErrors>Return the subset ofallValidationResultsthat includes Object method parameters with nested errors on their fields and properties.Return the method to which validation was applied.Return the target of the method invocation to which validation was applied.default List<ParameterValidationResult>Return the subset ofallValidationResultsthat includes method parameters with validation errors directly on method argument values.default booleanWhether the result contains any validation errors.booleanWhether the violations are for a return value.
- 
Method Details- 
getTargetObject getTarget()Return the target of the method invocation to which validation was applied.
- 
getMethodMethod getMethod()Return the method to which validation was applied.
- 
isForReturnValueboolean isForReturnValue()Whether the violations are for a return value. If true the violations are from validating a return value. If false the violations are from validating method arguments.
- 
hasErrorsdefault boolean hasErrors()Whether the result contains any validation errors.
- 
getAllErrorsReturn a single list with all errors from all validation results.
- 
getAllValidationResultsList<ParameterValidationResult> getAllValidationResults()Return all validation results. This includes both method parameters with errors directly on them, and Object method parameters with nested errors on their fields and properties.- See Also:
 
- 
getValueResultsReturn the subset ofallValidationResultsthat includes method parameters with validation errors directly on method argument values. This excludesbeanResultswith nested errors on their fields and properties.
- 
getBeanResultsReturn the subset ofallValidationResultsthat includes Object method parameters with nested errors on their fields and properties. This excludesvalueResultswith validation errors directly on method arguments.
- 
createstatic MethodValidationResult create(Object target, Method method, List<ParameterValidationResult> results) Factory method to create aMethodValidationResultinstance.- Parameters:
- target- the target Object
- method- the target method
- results- method validation results, expected to be non-empty
- Returns:
- the created instance
 
- 
emptyResultFactory method to create aMethodValidationResultinstance with 0 errors, suitable to use as a constant. Getters for a target object or method are not supported.
 
-