Class MapSettings


  • public class MapSettings
    extends Settings
    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 Detail

      • MapSettings

        public MapSettings()
    • Method Detail

      • get

        protected java.util.Optional<java.lang.String> get​(java.lang.String key)
        Specified by:
        get in class Settings
      • set

        protected void set​(java.lang.String key,
                           java.lang.String value)
        Description copied from class: Settings
        Add the settings with the specified key and value, both are trimmed and neither can be null.
        Specified by:
        set in class Settings
      • remove

        protected void remove​(java.lang.String key)
        Specified by:
        remove in class Settings
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Description copied from class: Settings
        Immutable map of the properties that have non-default values. The default values defined by PropertyDefinitions are ignored, so the returned values are not the effective values. Basically only the non-empty results of Settings.getRawString(String) are returned.

        Values are not decrypted if they are encrypted with a secret key.

        Specified by:
        getProperties in class Settings
      • clear

        public MapSettings clear()
        Delete all properties
      • setProperty

        public MapSettings setProperty​(java.lang.String key,
                                       java.lang.String value)
        Description copied from class: Settings
        Change 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
        Property is temporarily removed if the parameter value is null
        Overrides:
        setProperty in class Settings