-
-
Notifications
You must be signed in to change notification settings - Fork 21
GH-973 Rename and restructure placeholders configuration classes #1225
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: master
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.
Code Review
This pull request successfully refactors the placeholder configuration by moving it from a separate file into the main config.yml. This is a good move for consolidation and simplifies management. The introduction of the PlaceholdersSettings interface is a great choice for decoupling the configuration from its usage. The overall implementation is solid. I have one minor suggestion to improve code clarity and maintainability.
| @Override | ||
| public Map<String, String> placeholders() { | ||
| return placeholders; | ||
| } |
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.
The explicit implementation of the placeholders() method is redundant. The class-level @Getter and @Accessors(fluent = true) annotations will instruct Lombok to generate an identical method that correctly implements the PlaceholdersSettings interface. Removing this manual override will make the code cleaner and less verbose, fully leveraging Lombok's capabilities for boilerplate reduction.
|
|
||
| import java.util.Map; | ||
|
|
||
| public interface PlaceholdersSettings { |
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.
Ogolnie Settings odbieramy jako dane a nie zachowanie (MA SENS) w tym przypadku ten interfejs nie ma sensu dodaje tylko zloznosc bez zadnej wartosci bo nadal zalezy od konceptu Settings. Settings to tak naprawde tzw. Value object czyli javowy rekord/klasa. Interfejs to tylko kontrakt dla zachowan. Sens sie pojawia kiedy masz rozne zrodla konfiguracji wtedy Settings sam w sobie nadal jest value objectem
| class PlaceholdersSetup { | ||
|
|
||
| @Subscribe(EternalInitializeEvent.class) | ||
| void setUp(PlaceholderRegistry placeholders, PlaceholdersConfiguration config) { |
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.
Musimy tez wiedziec czym jest Configuration vs Config bo raz jest tak raz tak sama w sobie paczka implementation to jest zwykly wyciek abstrakcji niekontrolowany
| @Getter | ||
| @Accessors(fluent = true) |
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.
| @Getter | |
| @Accessors(fluent = true) |
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.
No, instead the author should remove the placeholders() getter explicitly. Annotations should be kept unless we are getting rid of the PlaceholdersSettings interface.
|
|
||
| import java.util.Map; | ||
|
|
||
| public interface PlaceholdersSettings { |
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.
I think an interface isn’t needed here. This is just a placeholders config, and at this point, I’m overengineering it.
| @Getter | ||
| @Accessors(fluent = true) |
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.
No, instead the author should remove the placeholders() getter explicitly. Annotations should be kept unless we are getting rid of the PlaceholdersSettings interface.
|
Follow other reviews - nothing to add (Commander keeps tagging me) |
No description provided.