-
Notifications
You must be signed in to change notification settings - Fork 469
refactor: FastExcelFactory #454
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
refactor: FastExcelFactory #454
Conversation
|
Hi, @weihubeats Please modify the commit message to better comply with the commit guidelines.The same applies to other PRs you have submitted. |
|
I've updated the PR title to comply with PR submission guidelines. |
We also recommend modifying the other PRs you submitted. |
|
ok |
psxjoy
left a comment
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.
LGTM.
If no one has other questions,I will merge this PR in 24h.
alaahong
left a comment
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.
Seems no any unit test with given changes?
|
Please add unit tests. |
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 refactors the FastExcelFactory class to reduce code duplication by introducing new conditional setter methods (*IfNotNull) across builder classes. The purpose is to eliminate repetitive null-checking patterns and simplify method implementations.
Key Changes:
- Introduced
*IfNotNullmethods in builder classes to conditionally set values only when non-null - Simplified FastExcelFactory methods by replacing verbose null-checking patterns with fluent method chaining
- Updated one method to delegate to another for consistency
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| FastExcelFactory.java | Refactored factory methods to use new conditional setter methods, eliminating repetitive null checks |
| ExcelWriterTableBuilder.java | Added tableNoIfNotNull method for conditional table number setting |
| ExcelWriterSheetBuilder.java | Added sheetNoIfNotNull and sheetNameIfNotNull methods for conditional setting |
| ExcelReaderSheetBuilder.java | Added sheetNoIfNotNull, sheetNameIfNotNull, and numRowsIfNotNull methods |
| AbstractExcelReaderParameterBuilder.java | Added registerReadListenerIfNotNull method for conditional listener registration |
| AbstractParameterBuilder.java | Added headIfNotNull method for conditional head class setting |
|
Test cases have now been added |
Purpose of the pull request
#453
What's changed?
reduce duplicate code
Checklist