Interface SettingStore
- All Superinterfaces:
SettingSource
- All Known Implementing Classes:
FunctionalStore,MapStore
SettingSource that supports modifying property values.
This interface extends SettingSource with methods for setting, unsetting, and clearing properties.
All stores that implement this interface provide read/write access and can be modified at runtime.
Sources vs Stores:
- Sources (
SettingSource) - Provide read-only access to property values - Stores (
SettingStore) - Provide read/write access to property values
Example:
-
Method Summary
Methods inherited from interface org.apache.juneau.commons.settings.SettingSource
get
-
Method Details
-
set
Sets a setting in this store.Setting a value to
null means thatSettingSource.get(String)will returnOptional.empty() for that key, effectively overriding any values from lower-priority sources. Useunset(String)if you wantSettingSource.get(String)to returnnull (indicating the key doesn't exist in this store).- Parameters:
name- The property name.value- The property value, ornull to set an empty override.
-
unset
Removes a setting from this store.After calling this method,
SettingSource.get(String)will returnnull for the specified key, indicating that the key doesn't exist in this store (as opposed to returningOptional.empty() , which would indicate the key exists but has a null value).- Parameters:
name- The property name to remove.
-
clear
void clear()Clears all settings from this store.After calling this method, all keys will be removed from this store, and
SettingSource.get(String)will returnnull for all keys.
-