mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-19 20:25:31 +00:00
Bug 4702: Added a default implementation for extraction methods of
ComponentLifecycle. This will save redundant implementations where the user and document settings are just all settings.
This commit is contained in:
+6
-2
@@ -40,7 +40,9 @@ public interface ComponentLifecycle<S extends Settings> {
|
||||
* @return User Settings extracted from the provided settings
|
||||
* @see ComponentContext
|
||||
*/
|
||||
S extractUserSettings(S settings);
|
||||
default S extractUserSettings(S settings) {
|
||||
return settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts Document Settings from provided {@link Settings}.
|
||||
@@ -49,6 +51,8 @@ public interface ComponentLifecycle<S extends Settings> {
|
||||
* @return Document Settings extracted from the provided settings
|
||||
* @see ComponentContext
|
||||
*/
|
||||
S extractDocumentSettings(S settings);
|
||||
default S extractDocumentSettings(S settings) {
|
||||
return settings;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user