com.atlassian.sal.core.pluginsettings
Class AbstractStringPluginSettings

java.lang.Object
  extended by com.atlassian.sal.core.pluginsettings.AbstractStringPluginSettings
All Implemented Interfaces:
PluginSettings

public abstract class AbstractStringPluginSettings
extends Object
implements PluginSettings

PluginSettings implementation for datastores that only support Strings. Handles converting Strings into Lists and Properties objects using a '#TYPE_IDENTIFIER' header on the string.


Constructor Summary
AbstractStringPluginSettings()
           
 
Method Summary
 Object get(String key)
          Gets a setting value.
protected abstract  String getActual(String key)
          Get the actual value
 Object put(String key, Object value)
          Puts a setting value.
protected abstract  void putActual(String key, String val)
          Put the actual value.
 Object remove(String key)
          Removes a setting value
protected abstract  void removeActual(String key)
          Do the actual remove.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStringPluginSettings

public AbstractStringPluginSettings()
Method Detail

put

public Object put(String key,
                  Object value)
Puts a setting value.

Specified by:
put in interface PluginSettings
Parameters:
key - Setting key. Cannot be null
value - Setting value. Must be one of String, List, Properties, Map, or null. null will remove the item from the settings.
Returns:
The setting value that was over ridden. Null if none existed.
Throws:
IllegalArgumentException - if value is not String, List, Properties, Map, or null.

get

public Object get(String key)
Gets a setting value. The setting returned should be specific to this context settings object and not cascade the value to a global context.

Specified by:
get in interface PluginSettings
Parameters:
key - The setting key. Cannot be null
Returns:
The setting value. May be null

remove

public Object remove(String key)
Removes a setting value

Specified by:
remove in interface PluginSettings
Parameters:
key - The setting key
Returns:
The setting value that was removed. Null if nothing was removed.

putActual

protected abstract void putActual(String key,
                                  String val)
Put the actual value.

Parameters:
key - The key to put it at.
val - The value

getActual

protected abstract String getActual(String key)
Get the actual value

Parameters:
key - The key to get
Returns:
The value

removeActual

protected abstract void removeActual(String key)
Do the actual remove. This will only be called if the value already exists.

Parameters:
key - The key to remove


Copyright © 2015 Atlassian. All rights reserved.