Conversation
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.