|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.emarsys.ecommon.prefs.config.backend.ImmutableConfigurationBackend
public class ImmutableConfigurationBackend
An immutable or read-only wrapper for ConfigurationBackend
s.
An ImmutableConfigurationBackend
will behave exactly like
its wrapped ConfigurationBackend
but prevent changes
by throwing ImmutableObjectException
s on every call to
set(ISetting)
.
Field Summary | |
---|---|
protected ConfigurationBackend |
backend
|
Constructor Summary | |
---|---|
ImmutableConfigurationBackend(ConfigurationBackend backend)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
ISetting |
get(java.lang.String name)
Retrieves the ISetting with the passed name. |
protected java.lang.reflect.InvocationHandler |
getInvocationHandler()
Creates a new InvocationHandler that will forward
requests to this instance,
see #wrap(ConfigurationBackend) . |
java.util.List<ISetting> |
getSettings()
Retrieves all ISetting s from this backend. |
int |
hashCode()
|
void |
set(ISetting setting)
Will throw an ImmutableObjectException if called. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ConfigurationBackend backend
Constructor Detail |
---|
public ImmutableConfigurationBackend(ConfigurationBackend backend)
backend
- Method Detail |
---|
public ISetting get(java.lang.String name) throws java.lang.IllegalArgumentException
ConfigurationBackend
ISetting
with the passed name.
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 java.util.List<ISetting> getSettings()
ConfigurationBackend
Retrieves all ISetting
s from this backend.
What exactly "all" means in the context of the concrete
ConfigurationBackend
is up to the implementation.
For instance the List
may or may not contain
default values or fallbacked ISetting
s or might
even return a cached list.
The only requirement for this method is to be logically in
synch with ConfigurationBackend.get(String)
and ConfigurationBackend.set(ISetting)
.
Thus if a Setting is inserted/updated/deleted and nothing
is changed in the meantime the next call to
ConfigurationBackend.getSettings()
has to reflect the changes made.
getSettings
in interface ConfigurationBackend
List
of ISetting
s,
never null
.com.emarsys.core.setting.backend.ConfigurationBackend#getSettings()
public void set(ISetting setting) throws java.lang.IllegalArgumentException, ImmutableObjectException
ImmutableObjectException
if called.
set
in interface ConfigurationBackend
ImmutableObjectException
- - in any case
java.lang.IllegalArgumentException
- - if the passed setting,
its name or value is null
.com.emarsys.core.setting.backend.ConfigurationBackend#set(com.emarsys.ecommon.prefs.config.ISetting)
protected java.lang.reflect.InvocationHandler getInvocationHandler()
InvocationHandler
that will forward
requests to this instance,
see #wrap(ConfigurationBackend)
.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |