Package com.shri.restinpeace.validator
Class ValidationResult
java.lang.Object
com.shri.restinpeace.validator.ValidationResult
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanRecords a validation error.Joins every recorded error into a single human-readable string.Returns the errors collected so far.booleanhasError()Returns whether any error has been recorded.
-
Constructor Details
-
ValidationResult
public ValidationResult()Creates an empty result with no errors recorded yet.
-
-
Method Details
-
getErrors
Returns the errors collected so far.- Returns:
- the errors
-
addError
Records a validation error.- Parameters:
error- the error message- Returns:
- always
true, perList.add(E)
-
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
-