Class ParameterValidationResult

java.lang.Object
org.springframework.validation.beanvalidation.ParameterValidationResult
Direct Known Subclasses:
ParameterErrors

public class ParameterValidationResult extends Object
Store and expose the results of method validation via Validator for a specific method parameter.
Since:
6.1
Author:
Rossen Stoyanchev
  • Constructor Details

  • Method Details

    • getMethodParameter

      public MethodParameter getMethodParameter()
      The method parameter the validation results are for.
    • getArgument

      @Nullable public Object getArgument()
      The method argument value that was validated.
    • getResolvableErrors

      public List<MessageSourceResolvable> getResolvableErrors()
      List of MessageSourceResolvable representations adapted from the underlying violations.
      • For a constraints directly on a method parameter, error codes are based on the names of the constraint annotation, the object, the method, the parameter, and parameter type, e.g. ["Max.myObject#myMethod.myParameter", "Max.myParameter", "Max.int", "Max"]. Arguments include the parameter itself as a MessageSourceResolvable, e.g. ["myObject#myMethod.myParameter", "myParameter"], followed by actual constraint annotation attributes (i.e. excluding "message", "groups" and "payload") in alphabetical order of attribute names.
      • For cascaded constraints via @Valid on a bean method parameter, this method returns field errors that you can also access more conveniently through methods of the ParameterErrors sub-class.
    • getViolations

      public List<ConstraintViolation<Object>> getViolations()
      The violations associated with the method parameter, in the same order as getResolvableErrors().
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object