Class ConfigMap

  • Direct Known Subclasses:
    MarshallingConfig

    public class ConfigMap
    extends Object
    Simple wrapper for a Map with configuration.
    Since:
    1.0.0
    • Constructor Detail

      • ConfigMap

        public ConfigMap()
        The constructor.
      • ConfigMap

        public ConfigMap​(Map<String,​Object> map)
        The constructor.
        Parameters:
        map - the raw Map with the configuration values.
    • Method Detail

      • get

        public <T> T get​(ConfigOption<T> option)
        Type Parameters:
        T - type of config value.
        Parameters:
        option - the ConfigOption.
        Returns:
        the configuration value for the given ConfigOption.
      • set

        public <T> T set​(ConfigOption<T> key,
                         T value)
        Type Parameters:
        T - type of config value.
        Parameters:
        key - the ConfigOption.
        value - the new configuration value for the given ConfigOption.
        Returns:
        the old configuration value that was previously associated with the given ConfigOption. Will be null if no value was configured before.
      • getMap

        public Map<String,​Object> getMap()
        Returns:
        the raw Map with the configuration.