Class DefaultConfigurationMap

    • Constructor Detail

      • DefaultConfigurationMap

        public DefaultConfigurationMap​(Map<String,​Variant> configuration)
        Creates a new DefaultConfigurationMap, backed by the provided map.
        Parameters:
        configuration - a map with configuration properties
    • Method Detail

      • get

        public <T> Optional<T> get​(String key,
                                   Class<T> clazz)
        Description copied from interface: ConfigurationMap
        Returns the value stored under the provided key and maps it to the provided class. If the key is not found in the map - an empty Optional is returned.
        Specified by:
        get in interface ConfigurationMap
        Type Parameters:
        T - type of the provided class
        Parameters:
        key - key under which the value is stored
        clazz - a class to which the value will be mapped
        Returns:
        an object of a given class, created by mapping the value
      • size

        public int size()
        Returns the number of existing keys in the configuration
        Specified by:
        size in interface ConfigurationMap
        Returns:
        the number of existing keys