Class ValidationResult

java.lang.Object
com.shri.restinpeace.validator.ValidationResult
All Implemented Interfaces:
Serializable

public class ValidationResult extends Object implements Serializable
Accumulates validation errors found while checking a @RestClient interface, so ReflectiveRestClientValidator can report every problem at once instead of failing on the first one.
See Also:
  • Constructor Details

    • ValidationResult

      public ValidationResult()
      Creates an empty result with no errors recorded yet.
  • Method Details

    • getErrors

      public List<String> getErrors()
      Returns the errors collected so far.
      Returns:
      the errors
    • addError

      public boolean addError(String error)
      Records a validation error.
      Parameters:
      error - the error message
      Returns:
      always true, per List.add(E)
    • getAllErrors

      public String getAllErrors()
      Joins every recorded error into a single human-readable string.
      Returns:
      the joined errors
    • hasError

      public boolean hasError()
      Returns whether any error has been recorded.
      Returns:
      true if at least one error was recorded