Class StringMapConfiguration

    • Constructor Detail

      • StringMapConfiguration

        public StringMapConfiguration​(@Nonnull
                                      java.util.Map<java.lang.String,​java.lang.String> map)
        Map constructor.
        Parameters:
        map - The map to back this configuration.
        Throws:
        java.lang.NullPointerException - if the given map is null.
      • StringMapConfiguration

        public StringMapConfiguration​(@Nonnull
                                      java.util.Map<java.lang.String,​java.lang.String> map,
                                      @Nullable
                                      Configuration parentConfiguration)
        Parent configuration and map constructor.
        Parameters:
        map - The map to back this configuration.
        parentConfiguration - The parent configuration to use for fallback lookup, or null if there is no parent configuration.
        Throws:
        java.lang.NullPointerException - if the given map is null.
    • Method Detail

      • hasParameterImpl

        protected boolean hasParameterImpl​(java.lang.String key)
                                    throws ConfigurationException
        Determines whether a parameter is present in the underlying storage.

        The given parameter key is assumed to already be normalized, and should not be modified.

        This method must not fall back to parent configuration; only local values must be returned.

        The default implementation delegates to BaseConfiguration.findParameterImpl(String).

        This implementation delegates to Map.containsKey(Object).
        Overrides:
        hasParameterImpl in class BaseConfiguration<java.lang.String>
        Parameters:
        key - The normalized parameter key.
        Returns:
        true if a parameter of type type could be retrieved from these parameters using the given key.
        Throws:
        ConfigurationException - if there is a parameter value stored in an invalid format.
      • findParameterImpl

        protected java.util.Optional<java.lang.String> findParameterImpl​(java.lang.String key)
                                                                  throws ConfigurationException
        Implementation to retrieves a general parameter that may not be present from the underlying storage.

        The given parameter key is assumed to already be normalized, and should not be modified.

        This method must not fall back to parent configuration; only local values must be returned.

        This implementation delegates to Map.get(Object).
        Specified by:
        findParameterImpl in class BaseConfiguration<java.lang.String>
        Parameters:
        key - The normalized parameter key.
        Returns:
        The optional value of the parameter associated with the given key.
        Throws:
        ConfigurationException - if there is a parameter value stored in an invalid format.