Package io.jans.casa.service.settings
Interface IPluginSettingsHandler<T>
- Type Parameters:
T- The type of the configuration (a class modeling the data to handle)
public interface IPluginSettingsHandler<T>
Allows for reading, modifying and saving config data for a plugin in the underlying database. No low-level access
details involved.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a deep clone copy of the configuration: If the object returned by this call is modified andsave()is called, no changes will be reflected.voidsave()Persists the data to the database.voidsetSettings(T settings) Sets the configuration.
-
Method Details
-
save
Persists the data to the database. More specifically, the value already set via methodsetSettings(Object).- Throws:
Exception- When there was an unexpected problem saving.
-
getSettings
T getSettings()Returns a deep clone copy of the configuration: If the object returned by this call is modified andsave()is called, no changes will be reflected. UsesetSettings(Object)beforehand- Returns:
-
setSettings
Sets the configuration. This only alters the in-memory copy of the runtime configuration of the app. To make it persistent, callsave().- Parameters:
settings- Data object.
-