Class Configuration
- java.lang.Object
-
- org.apache.flink.cdc.common.configuration.Configuration
-
- All Implemented Interfaces:
Serializable,Cloneable
public class Configuration extends Object implements Serializable, Cloneable
Lightweight configuration object which stores key/value pairs.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Configuration()Creates a new empty configuration.Configuration(Configuration other)Creates a new configuration with the copy of the given configuration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(Configuration other)Configurationclone()booleancontains(ConfigOption<?> configOption)Checks whether there is an entry for the given config option.booleanequals(Object obj)static ConfigurationfromMap(Map<String,String> map)Creates a new configuration that is initialized with the options of the given map.<T> Tget(ConfigOption<T> option)Set<String>getKeys()<T> Optional<T>getOptional(ConfigOption<T> option)inthashCode()Set<String>keySet()Returns the keys of all key/value pairs stored inside this configuration object.<T> booleanremove(ConfigOption<T> configOption)Removes given config option from the configuration.<T> Configurationset(ConfigOption<T> option, T value)Map<String,String>toMap()StringtoString()
-
-
-
Constructor Detail
-
Configuration
public Configuration()
Creates a new empty configuration.
-
Configuration
public Configuration(Configuration other)
Creates a new configuration with the copy of the given configuration.- Parameters:
other- The configuration to copy the entries from.
-
-
Method Detail
-
fromMap
public static Configuration fromMap(Map<String,String> map)
Creates a new configuration that is initialized with the options of the given map.
-
addAll
public void addAll(Configuration other)
-
clone
public Configuration clone()
-
contains
public boolean contains(ConfigOption<?> configOption)
Checks whether there is an entry for the given config option.- Parameters:
configOption- The configuration option- Returns:
- true if a valid (current or deprecated) key of the config option is stored, false otherwise
-
get
public <T> T get(ConfigOption<T> option)
-
getOptional
public <T> Optional<T> getOptional(ConfigOption<T> option)
-
set
public <T> Configuration set(ConfigOption<T> option, T value)
-
keySet
public Set<String> keySet()
Returns the keys of all key/value pairs stored inside this configuration object.- Returns:
- the keys of all key/value pairs stored inside this configuration object
-
remove
public <T> boolean remove(ConfigOption<T> configOption)
Removes given config option from the configuration.- Type Parameters:
T- Type of the config option- Parameters:
configOption- config option to remove- Returns:
- true is config has been removed, false otherwise
-
-