Package org.sonar.api.config.internal
Class MapSettings
java.lang.Object
org.sonar.api.config.Settings
org.sonar.api.config.internal.Settings
org.sonar.api.config.internal.MapSettings
In-memory map-based implementation of
Settings. It must be used
only for unit tests. This is not the implementation
deployed at runtime, so non-test code must never cast
Settings to MapSettings.- Since:
- 6.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.sonar.api.config.ConfigurationasConfig()clear()Delete all propertiesImmutable map of the properties that have non-default values.protected voidprotected voidAdd the settings with the specified key and value, both are trimmed and neither can be null.setProperty(String key, Boolean value) setProperty(String key, Integer value) setProperty(String key, Long value) setProperty(String key, String value) Change a property value in a restricted scope only, depending on execution context.Methods inherited from class org.sonar.api.config.internal.Settings
addProperties, addProperties, appendProperty, getBoolean, getDate, getDateTime, getDefaultValue, getDefinition, getDefinitions, getDouble, getEncryption, getFloat, getInt, getKeysStartingWith, getLong, getRawString, getString, getStringArray, getStringArrayBySeparator, getStringLines, hasDefaultValue, hasKey, removeProperty, setProperty, setProperty, setProperty, setProperty, setProperty
-
Constructor Details
-
MapSettings
public MapSettings() -
MapSettings
public MapSettings(org.sonar.api.config.PropertyDefinitions definitions)
-
-
Method Details
-
get
-
set
Description copied from class:SettingsAdd the settings with the specified key and value, both are trimmed and neither can be null. -
remove
-
getProperties
Description copied from class:SettingsImmutable map of the properties that have non-default values. The default values defined byPropertyDefinitionsare ignored, so the returned values are not the effective values. Basically only the non-empty results ofSettings.getRawString(String)are returned.Values are not decrypted if they are encrypted with a secret key.
- Specified by:
getPropertiesin classSettings
-
clear
Delete all properties -
setProperty
Description copied from class:SettingsChange a property value in a restricted scope only, depending on execution context. New value is never persisted. New value is ephemeral and kept in memory only:- during current analysis in the case of scanner stack
- during processing of current HTTP request in the case of web server stack
- during execution of current task in the case of Compute Engine stack
valueisnull- Overrides:
setPropertyin classSettings
-
setProperty
- Overrides:
setPropertyin classSettings- See Also:
-
setProperty
- Overrides:
setPropertyin classSettings- See Also:
-
setProperty
- Overrides:
setPropertyin classSettings- See Also:
-
asConfig
public org.sonar.api.config.Configuration asConfig()- Returns:
- a
Configurationproxy on top of this existingSettingsimplementation. Changes are reflected in theConfigurationobject. - Since:
- 6.5
-