-
Couldn't load subscription status.
- Fork 1
Use builder pattern with Lombok in all model classes #332
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the codebase by consistently replacing manual object instantiation and setter calls with Lombok's builder pattern across all model classes. The migration improves code readability, reduces boilerplate, and ensures thread-safe object construction.
Key changes include:
- Replaced
@NoArgsConstructorand@AllArgsConstructorwith@Builderor@SuperBuilderfor inheritance - Updated all object creation from
new Model()+ setters toModel.builder().field(value).build() - Modernized static example instances to use builder pattern
Reviewed Changes
Copilot reviewed 95 out of 95 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| Model classes (commons) | Added @Builder/@SuperBuilder annotations and updated example instances |
| Service implementations | Replaced object instantiation with builder pattern usage |
| Test classes | Updated test object creation to use builders |
| Utility classes | Modernized model creation in utility methods |
jira/src/test/java/com/deftdevs/bootstrapi/jira/model/util/DirectoryModelUtilTest.java
Show resolved
Hide resolved
jira/src/main/java/com/deftdevs/bootstrapi/jira/model/util/MailServerPopModelUtil.java
Show resolved
Hide resolved
...ence/src/main/java/com/deftdevs/bootstrapi/confluence/model/util/MailServerPopModelUtil.java
Outdated
Show resolved
Hide resolved
...ence/src/main/java/com/deftdevs/bootstrapi/confluence/model/util/MailServerPopModelUtil.java
Show resolved
Hide resolved
| DirectoryDelegatingModel directoryDelegatingModel = (DirectoryDelegatingModel) directoryModel; | ||
| directoryDelegatingModel.setPermissions(permissions); | ||
| // Only set permissions if the builder supports it | ||
| if (builder instanceof DirectoryInternalModel.DirectoryInternalModelBuilder) { |
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using instanceof checks on builder types is fragile and breaks the abstraction. Consider using method overloading or a more robust polymorphic approach to handle different directory types.
commons/src/main/java/com/deftdevs/bootstrapi/commons/model/MailServerSmtpModel.java
Show resolved
Hide resolved
commons/src/main/java/com/deftdevs/bootstrapi/commons/model/MailServerPopModel.java
Show resolved
Hide resolved
5451600 to
e2b55f6
Compare
|


No description provided.