Class DefaultConfiguration

    • Constructor Detail

      • DefaultConfiguration

        public DefaultConfiguration()
        Creates an empty property list with no default values.
    • Method Detail

      • getConfigProperty

        public String getConfigProperty​(String key)
        Returns the configuration property with the specified key.
        Specified by:
        getConfigProperty in interface Configuration
        Parameters:
        key - the property key.
        Returns:
        the property value.
      • getConfigProperty

        public String getConfigProperty​(String key,
                                        String defaultValue)
        Returns the configuration property with the specified key (or the specified default value if there is no such property).

        If the property is not defined in this configuration, the code will lookup the property in the parent configuration.

        Specified by:
        getConfigProperty in interface Configuration
        Parameters:
        key - the property key.
        defaultValue - the default value.
        Returns:
        the property value.
      • findPropertyKeys

        public Iterator<String> findPropertyKeys​(String prefix)
        Searches all property keys that start with a given prefix.
        Specified by:
        findPropertyKeys in interface Configuration
        Parameters:
        prefix - the prefix that all selected property keys should share
        Returns:
        the properties as iterator.
      • setConfigProperty

        public void setConfigProperty​(String key,
                                      String value)
        Sets the value of a configuration property.
        Specified by:
        setConfigProperty in interface ModifiableConfiguration
        Parameters:
        key - the property key.
        value - the property value.