Skip to content
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

Merged
merged 5 commits into from Mar 9, 2020

Conversation

kaikreuzer
Copy link
Member

Also refactored Simple... classes to Persistence.... classes (that's actually 95% of the changes).

Signed-off-by: Kai Kreuzer kai@openhab.org

Signed-off-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
@cweitkamp cweitkamp added enhancement An enhancement or new feature of the Core persistence labels Mar 8, 2020
Copy link
Contributor

@cweitkamp cweitkamp left a 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();
Copy link
Contributor

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:

Suggested change
List<PersistenceStrategy> getDefaultStrategies();
default List<PersistenceStrategy> getDefaultStrategies() {
return Collections.emptyList();
}

Be aware of an eventually missing import.

Copy link
Member Author

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.

kaikreuzer and others added 3 commits March 8, 2020 21:20
…/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>
Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@cweitkamp cweitkamp merged commit 427e969 into openhab:master Mar 9, 2020
@cweitkamp cweitkamp added this to the 3.0 milestone Apr 6, 2020
@openhab-bot
Copy link
Collaborator

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

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
…openhab#1387)

* Allow persistence services to define default strategies
* Added null annotations

Signed-off-by: Kai Kreuzer <kai@openhab.org>
GitOrigin-RevId: 427e969
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core persistence
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants