Skip to content

Add builder pattern to ConstraintViolation #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

making
Copy link
Owner

@making making commented Apr 16, 2025

Summary

This PR introduces a staged builder pattern for the ConstraintViolation class to provide a more fluent and type-safe API for creating constraint violations.

Changes

  • Add StagedBuilders interface hierarchy to enforce required properties
  • Implement a fluent Builder class with various convenience methods
  • Make existing constructor deprecated in favor of the builder
  • Add null-safety with @nullable annotations and fallback defaults
  • Add comprehensive JavaDoc to all new methods
  • Create tests for all builder pattern functionality

The new API makes it easier to create properly configured constraint violations while ensuring type safety and required properties.

This commit introduces a staged builder pattern for the ConstraintViolation class
to provide a more fluent and type-safe API for creating constraint violations.

Main changes:
- Add StagedBuilders interface hierarchy to enforce required properties
- Implement a fluent Builder class with various convenience methods
- Make existing constructor deprecated in favor of the builder
- Add null-safety with @nullable annotations and fallback defaults
- Add comprehensive JavaDoc to all new methods
- Create tests for all builder pattern functionality

The new API makes it easier to create properly configured constraint violations
while ensuring type safety and required properties.
@making making merged commit fea06b4 into develop Apr 17, 2025
4 checks passed
@making making deleted the feature/constraint-violation-builder branch April 17, 2025 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant