Package com.powsybl.commons.config
Class EnvironmentMapModuleConfig
- java.lang.Object
-
- com.powsybl.commons.config.AbstractModuleConfig
-
- com.powsybl.commons.config.AbstractMapModuleConfig
-
- com.powsybl.commons.config.MapModuleConfig
-
- com.powsybl.commons.config.EnvironmentMapModuleConfig
-
- All Implemented Interfaces:
ModuleConfig
public class EnvironmentMapModuleConfig extends MapModuleConfig
AModuleConfig
designed to read property values from the map of environment variables. For a configuration property named "property-name" in module "module-name", the expected environment variables name is MODULE_NAME__PROPERTY_NAME. CamelCase names are also translated to underscore-separated names.- Author:
- Yichen TANG
-
-
Constructor Summary
Constructors Constructor Description EnvironmentMapModuleConfig(Map<Object,Object> properties, FileSystem fs, String moduleName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getPropertyNames()
protected Object
getValue(String propertyName)
Returns the value of the property with the specified name, ornull
if it does not exist.boolean
hasProperty(String name)
-
Methods inherited from class com.powsybl.commons.config.MapModuleConfig
setClassProperty, setPathProperty, setStringListProperty, setStringProperty
-
Methods inherited from class com.powsybl.commons.config.AbstractMapModuleConfig
getOptionalBooleanProperty, getOptionalDateTimeProperty, getOptionalDoubleProperty, getOptionalFloatProperty, getOptionalIntProperty, getOptionalLongProperty, getOptionalPathListProperty, getOptionalPathProperty, getOptionalStringListProperty, getOptionalStringProperty
-
Methods inherited from class com.powsybl.commons.config.AbstractModuleConfig
getBooleanProperty, getBooleanProperty, getClassProperty, getClassProperty, getDateTimeProperty, getDoubleProperty, getDoubleProperty, getEnumProperty, getEnumProperty, getEnumSetProperty, getEnumSetProperty, getFloatProperty, getFloatProperty, getIntervalProperty, getIntProperty, getIntProperty, getLongProperty, getLongProperty, getOptionalClassProperty, getOptionalEnumProperty, getOptionalEnumSetProperty, getOptionalIntervalProperty, getPathListProperty, getPathProperty, getPathProperty, getStringListProperty, getStringListProperty, getStringProperty, getStringProperty
-
-
-
-
Constructor Detail
-
EnvironmentMapModuleConfig
public EnvironmentMapModuleConfig(Map<Object,Object> properties, FileSystem fs, String moduleName)
-
-
Method Detail
-
hasProperty
public boolean hasProperty(String name)
- Specified by:
hasProperty
in interfaceModuleConfig
- Overrides:
hasProperty
in classMapModuleConfig
-
getValue
protected Object getValue(String propertyName)
Description copied from class:AbstractMapModuleConfig
Returns the value of the property with the specified name, ornull
if it does not exist. The returned object may be aString
or directly a more specialized type (Date
orFloat
for instance).- Overrides:
getValue
in classMapModuleConfig
- Parameters:
propertyName
- The name of the property to be looked up- Returns:
- The value of the specified property it it exists,
null
otherwise.
-
getPropertyNames
public Set<String> getPropertyNames()
- Specified by:
getPropertyNames
in interfaceModuleConfig
- Overrides:
getPropertyNames
in classMapModuleConfig
-
-