com.emarsys.ecommon.prefs.config.backend
Class ModeSettingConfigurationBackend
java.lang.Object
com.emarsys.ecommon.prefs.config.backend.ModeSettingConfigurationBackend
- All Implemented Interfaces:
- ConfigurationBackend
public class ModeSettingConfigurationBackend
- extends java.lang.Object
- implements ConfigurationBackend
A proxy to arbitrary ConfigurationBackend
s that
is associated with a specific SettingMode
.
Every ISetting
retrieved from the backend will
get its mode set correspondingly.
- Author:
- Michael "kULO" Kulovits
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mode
protected SettingMode mode
backend
protected ConfigurationBackend backend
ModeSettingConfigurationBackend
public ModeSettingConfigurationBackend(ConfigurationBackend backend,
SettingMode mode)
get
public ISetting get(java.lang.String name)
throws java.lang.IllegalArgumentException
- Every
ISetting
retrieved from this ConfigurationBackend
will have its SettingMode
set to mode
.
- Specified by:
get
in interface ConfigurationBackend
- Returns:
- the
ISetting
with the
passed name or null
if not present.
- Throws:
java.lang.IllegalArgumentException
- - if the passed name is
null
.- See Also:
com.emarsys.core.setting.backend.ConfigurationBackend#get(java.lang.String)
getSettings
public java.util.List<ISetting> getSettings()
- Every
ISetting
retrieved from this ConfigurationBackend
will have its SettingMode
set to mode
.
- Specified by:
getSettings
in interface ConfigurationBackend
- Returns:
- always a valid
List
of ISetting
s,
never null
. - See Also:
com.emarsys.core.setting.backend.ConfigurationBackend#getSettings()
set
public void set(ISetting setting)
throws java.lang.IllegalArgumentException
- Description copied from interface:
ConfigurationBackend
- Sets the passed setting which must not be
null
in this configuration backend, if a setting with the given
name is already present it will be overridden.
The next call to ConfigurationBackend.get(String)
with the passed
setting's name will return the passed setting.
- Specified by:
set
in interface ConfigurationBackend
- Throws:
java.lang.IllegalArgumentException
- - if the passed setting,
its name or value is null
.- See Also:
com.emarsys.core.setting.backend.ConfigurationBackend#set(ISetting)
Copyright © 2010 emarsys AG. All Rights Reserved.