|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.emarsys.ecommon.prefs.config.backend.DefaultsConfigurationBackend
public class DefaultsConfigurationBackend
A ConfigurationBackend
that supports default values.
Field Summary | |
---|---|
protected ConfigurationBackend |
defaults
|
protected ConfigurationBackend |
settings
|
Constructor Summary | |
---|---|
DefaultsConfigurationBackend(ConfigurationBackend settings,
ConfigurationBackend defaults)
Creates a new DefaultsConfigurationBackend with the passed
settings and its defaults. |
Method Summary | |
---|---|
static ConfigurationBackend |
cascade(ConfigurationBackend... backends)
Creates a new DefaultsConfigurationBackend with the passed
ConfigurationBackend recursively cascaded as the defaults
of its predecessor. |
static ConfigurationBackend |
cascade(java.util.List<ConfigurationBackend> backends)
Creates a new DefaultsConfigurationBackend with the passed
ConfigurationBackend recursively cascaded as the defaults
of its predecessor. |
ISetting |
get(java.lang.String name)
Looks for the specified ISetting in settings
and if not present the value in defaults will
be searched. |
java.util.List<ISetting> |
getSettings()
Returns all settings included the defaults for
missing ones in the wrapped backend. |
void |
set(ISetting setting)
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ConfigurationBackend settings
protected ConfigurationBackend defaults
Constructor Detail |
---|
public DefaultsConfigurationBackend(ConfigurationBackend settings, ConfigurationBackend defaults) throws java.lang.IllegalArgumentException
DefaultsConfigurationBackend
with the passed
settings and its defaults.
settings
- defaults
-
java.lang.IllegalArgumentException
Method Detail |
---|
public static ConfigurationBackend cascade(ConfigurationBackend... backends)
DefaultsConfigurationBackend
with the passed
ConfigurationBackend
recursively cascaded as the defaults
of its predecessor.
backends
- - the ConfigurationBackend
s to be cascaded
ConfigurationBackend
that uses the passed
backends for retrieving default values in their respective
order.cascade(List)
public static ConfigurationBackend cascade(java.util.List<ConfigurationBackend> backends)
DefaultsConfigurationBackend
with the passed
ConfigurationBackend
recursively cascaded as the defaults
of its predecessor.
backends
- - the ConfigurationBackend
s to be cascaded
ConfigurationBackend
that uses the passed
backends for retrieving default values in their respective
order.cascade(List)
public ISetting get(java.lang.String name) throws java.lang.IllegalArgumentException
ISetting
in settings
and if not present the value in defaults
will
be searched.
get
in interface ConfigurationBackend
ISetting
with the
passed name or null
if not present.
java.lang.IllegalArgumentException
- - if the passed name is
null
.com.emarsys.core.setting.backend.ConfigurationBackend#get(java.lang.String)
public void set(ISetting setting) throws java.lang.IllegalArgumentException
ConfigurationBackend
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.
set
in interface ConfigurationBackend
java.lang.IllegalArgumentException
- - if the passed setting,
its name or value is null
.com.emarsys.core.setting.backend.ConfigurationBackend#set(ISetting)
public java.util.List<ISetting> getSettings()
settings
included the defaults
for
missing ones in the wrapped backend.
getSettings
in interface ConfigurationBackend
List
of ISetting
s,
never null
.com.emarsys.core.setting.backend.ConfigurationBackend#getSettings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |