Package build.buf.protovalidate
Class ValidationResult
java.lang.Object
build.buf.protovalidate.ValidationResult
ValidationResult is returned when a constraint is executed. It contains a list of
violations. This is non-fatal. If there are no violations, the constraint is considered to have
passed.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValidationResultA violation result with an empty violation list. -
Constructor Summary
ConstructorsConstructorDescriptionValidationResult(List<Violation> violations) Creates a violation result from a list of violations. -
Method Summary
-
Field Details
-
EMPTY
A violation result with an empty violation list.
-
-
Constructor Details
-
ValidationResult
Creates a violation result from a list of violations.- Parameters:
violations- violation list for the result.
-
-
Method Details
-
isSuccess
public boolean isSuccess()Check if the result is successful.- Returns:
- if the validation result was a success.
-
getViolations
Get the list of violations in the result.- Returns:
- the violation list.
-
toString
Returns a string representation of the validation result, including all the violations.
-