Interface PluginSettings
public interface PluginSettings
Provides access to settings globally or per project/space/repository/build-plan
The following types are supported:
- java.lang.String
- java.util.List
- java.util.Properties
- java.util.Map
List and Map types must contain only String.
Implementations are only required to support writes of keys upto 100 characters in length and are expected to throw an exception if the key is longer than 255 characters. Keys should be kept as short as possible. Reads and removes must support keys longer than 256 characters.
Instances are assumed to be not threadsafe and mutable.
- Since:
- 2.0
-
Method Summary
-
Method Details
-
get
Gets a setting value. The setting returned should be specific to this context settings object and not cascade the value to a global context.- Parameters:
key- The setting key. Cannot be null- Returns:
- The setting value. May be null
- Throws:
IllegalArgumentException- if the key is null.
-
put
Puts a setting value.- Parameters:
key- Setting key. Cannot be null, keys longer than 100 characters are not supported.value- Setting value. Must be one ofString,List,Properties,Map, or null. null will remove the item from the settings. If the value is aStringit should not be longer than 99000 characters long. Values of a type other thanStringwill be serialized as aStringwhich cannot be longer than 99000 characters long.- Returns:
- The setting value that was over ridden. Null if none existed.
- Throws:
IllegalArgumentException- if value is not null,String,List,PropertiesorMap, or if the key is null or longer than 255 characters
-
remove
Removes a setting value- Parameters:
key- The setting key- Returns:
- The setting value that was removed. Null if nothing was removed.
- Throws:
IllegalArgumentException- if the key is null.
-