pip_services3_commons.config.IConfigurable module

pip_services3_commons.config.IConfigurable

Interface for components that require configuration

copyright

Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.

license

MIT, see LICENSE for more details.

class pip_services3_commons.config.IConfigurable.IConfigurable

Bases: abc.ABC

An interface to set configuration parameters to an object.

It can be added to any existing class by implementing a single configure() method.

If you need to emphasis the fact that configure() method can be called multiple times to change object configuration in runtime, use IReconfigurable interface instead.

Example:

class MyClass(IConfigurable):
   _myParam = "default args"

def configure(self, config):
   self._myParam = config.get_as_string_with_default("options.param", myParam)
configure(config: pip_services3_commons.config.ConfigParams.ConfigParams)

Configures object by passing configuration parameters.

Parameters

config – configuration parameters to be set.