Skip to content

Commit

Permalink
Update README violations to getViolations() (#175)
Browse files Browse the repository at this point in the history
First time setting up protovalidate-java, following the example given in
the readme `if (result.violations.isEmpty()) {`
brings up the following error:
```
violations has private access in build.buf.protovalidate.ValidationResult
```
Can fix by modifying to `if (result.getViolations().isEmpty()) {`
  • Loading branch information
lennysgarage authored Sep 3, 2024
1 parent 1f28be7 commit e54d068
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public class Main {
ValidationResult result = validator.validate(transaction);

// Check if there are any validation violations
if (result.violations.isEmpty()) {
if (result.getViolations().isEmpty()) {
// No violations, validation successful
System.out.println("Validation succeeded");
} else {
Expand Down

0 comments on commit e54d068

Please sign in to comment.