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
Allow persistence services to define default strategies #1387
Conversation
Signed-off-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
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.
Thank you. Some minor remarks.
* | ||
* @return The default persistence strategies | ||
*/ | ||
List<PersistenceStrategy> getDefaultStrategies(); |
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 know that this PR is APIBreaking anyways but you also can add the default method implementation here:
List<PersistenceStrategy> getDefaultStrategies(); | |
default List<PersistenceStrategy> getDefaultStrategies() { | |
return Collections.emptyList(); | |
} |
Be aware of an eventually missing import.
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 thought about this, but I decided against it. Problem with the default methods is that no method skeleton is created in implementing classes, so that developers are not aware that they should actually think about implementing the method.
...g.openhab.core.persistence/src/main/java/org/openhab/core/persistence/PersistenceFilter.java
Show resolved
Hide resolved
....persistence/src/main/java/org/openhab/core/persistence/internal/PersistenceManagerImpl.java
Outdated
Show resolved
Hide resolved
....persistence/src/main/java/org/openhab/core/persistence/internal/PersistenceManagerImpl.java
Outdated
Show resolved
Hide resolved
…/core/persistence/internal/PersistenceManagerImpl.java Co-Authored-By: Christoph Weitkamp <github@christophweitkamp.de>
…/core/persistence/internal/PersistenceManagerImpl.java Co-Authored-By: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
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. Thanks.
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab3-first-feedback-on-editing-entities/105075/27 |
…openhab#1387) * Allow persistence services to define default strategies * Added null annotations Signed-off-by: Kai Kreuzer <kai@openhab.org> GitOrigin-RevId: 427e969
Also refactored Simple... classes to Persistence.... classes (that's actually 95% of the changes).
Signed-off-by: Kai Kreuzer kai@openhab.org