Class DefaultConfigurationMap
- java.lang.Object
-
- com.snowflake.connectors.application.configuration.DefaultConfigurationMap
-
- All Implemented Interfaces:
ConfigurationMap
public class DefaultConfigurationMap extends Object implements ConfigurationMap
Default implementation ofConfigurationMap
, which usesVariantMapper
for value mapping.
-
-
Constructor Summary
Constructors Constructor Description DefaultConfigurationMap(Map<String,Variant> configuration)
Creates a newDefaultConfigurationMap
, backed by the provided map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Optional<T>
get(String key, Class<T> clazz)
Returns the value stored under the provided key and maps it to the provided class.int
size()
Returns the number of existing keys in the configuration
-
-
-
Constructor Detail
-
DefaultConfigurationMap
public DefaultConfigurationMap(Map<String,Variant> configuration)
Creates a newDefaultConfigurationMap
, 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 interfaceConfigurationMap
- Type Parameters:
T
- type of the provided class- Parameters:
key
- key under which the value is storedclazz
- 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 interfaceConfigurationMap
- Returns:
- the number of existing keys
-
-