Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.localconfiguration.simple
Class SimpleConfigurationAdapter

java.lang.Object
  extended by org.nuxeo.ecm.core.api.localconfiguration.AbstractLocalConfiguration<SimpleConfiguration>
      extended by org.nuxeo.ecm.platform.localconfiguration.simple.SimpleConfigurationAdapter
All Implemented Interfaces:
DetachedAdapter, LocalConfiguration<SimpleConfiguration>, SimpleConfiguration
Direct Known Subclasses:
SimpleUserPreferences

public class SimpleConfigurationAdapter
extends AbstractLocalConfiguration<SimpleConfiguration>
implements SimpleConfiguration

Default implementation of SimpleConfiguration.

Since:
5.4.3
Author:
Thomas Roger
See Also:
SimpleConfiguration

Field Summary
 
Fields inherited from interface org.nuxeo.ecm.platform.localconfiguration.simple.SimpleConfiguration
SIMPLE_CONFIGURATION_FACET, SIMPLE_CONFIGURATION_PARAMETER_KEY, SIMPLE_CONFIGURATION_PARAMETER_VALUE, SIMPLE_CONFIGURATION_PARAMETERS_PROPERTY, SIMPLE_CONFIGURATION_SCHEMA
 
Constructor Summary
SimpleConfigurationAdapter(DocumentModel doc)
           
 
Method Summary
 boolean canMerge()
          Returns true if this LocalConfiguration accepted to be merged with a parent configuration, false otherwise.
 String get(String key)
          Returns the value to which the specified key is mapped, or null if there is no mapping for the key.
 String get(String key, String defaultValue)
          Returns the value to which the specified key is mapped, or the given default value if there is no mapping for the key.
 DocumentRef getDocumentRef()
          Returns the related DocumentRef of this local configuration.
 SimpleConfiguration merge(SimpleConfiguration other)
          Merge this LocalConfiguration with another one.
 String put(String key, String value)
          Associates the specified value with the specified key.
 void putAll(Map<String,String> parameters)
          Copies all of the parameters from the specified map to this Simple configuration
 void save(CoreSession session)
          Save this LocalConfiguration.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleConfigurationAdapter

public SimpleConfigurationAdapter(DocumentModel doc)
Method Detail

get

public String get(String key)
Description copied from interface: SimpleConfiguration
Returns the value to which the specified key is mapped, or null if there is no mapping for the key.

Specified by:
get in interface SimpleConfiguration
Parameters:
key - the key whose associated value is to be returned

get

public String get(String key,
                  String defaultValue)
Description copied from interface: SimpleConfiguration
Returns the value to which the specified key is mapped, or the given default value if there is no mapping for the key.

Specified by:
get in interface SimpleConfiguration
Parameters:
key - the key whose associated value is to be returned
defaultValue - the value returned if there is no mapping for the key

put

public String put(String key,
                  String value)
Description copied from interface: SimpleConfiguration
Associates the specified value with the specified key.

If the map previously contained a mapping for the key, the old value is replaced by the specified value.

Specified by:
put in interface SimpleConfiguration
Parameters:
key - key with which the specified value is to be associated
value - value to be associated with the specified key
Returns:
the previous value associated with key, or null if there was no mapping for key.

putAll

public void putAll(Map<String,String> parameters)
Description copied from interface: SimpleConfiguration
Copies all of the parameters from the specified map to this Simple configuration

Specified by:
putAll in interface SimpleConfiguration
Parameters:
parameters - parameters to be stored in this Simple configuration

getDocumentRef

public DocumentRef getDocumentRef()
Description copied from interface: LocalConfiguration
Returns the related DocumentRef of this local configuration.

Specified by:
getDocumentRef in interface LocalConfiguration<SimpleConfiguration>

canMerge

public boolean canMerge()
Description copied from interface: LocalConfiguration
Returns true if this LocalConfiguration accepted to be merged with a parent configuration, false otherwise.

Specified by:
canMerge in interface LocalConfiguration<SimpleConfiguration>
Overrides:
canMerge in class AbstractLocalConfiguration<SimpleConfiguration>

merge

public SimpleConfiguration merge(SimpleConfiguration other)
Description copied from interface: LocalConfiguration
Merge this LocalConfiguration with another one.

Specified by:
merge in interface LocalConfiguration<SimpleConfiguration>
Overrides:
merge in class AbstractLocalConfiguration<SimpleConfiguration>

save

public void save(CoreSession session)
          throws ClientException
Description copied from interface: LocalConfiguration
Save this LocalConfiguration.

Specified by:
save in interface LocalConfiguration<SimpleConfiguration>
Overrides:
save in class AbstractLocalConfiguration<SimpleConfiguration>
Throws:
ClientException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.