public class SystemEnvironmentVariables extends Object implements EnvironmentVariables
| Constructor and Description |
|---|
SystemEnvironmentVariables() |
SystemEnvironmentVariables(Properties systemProperties,
Map<String,String> systemValues) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactiveEnvironmentspublic SystemEnvironmentVariables()
public SystemEnvironmentVariables(Properties systemProperties, Map<String,String> systemValues)
public EnvironmentVariables copy()
copy in interface EnvironmentVariablespublic static EnvironmentVariables currentEnvironmentVariables()
public void setConfig(com.typesafe.config.Config typesafeConfig)
setConfig in interface EnvironmentVariablespublic String getValue(String name)
getValue in interface EnvironmentVariablespublic String getValue(Enum<?> property)
getValue in interface EnvironmentVariablespublic String getValue(String name, String defaultValue)
getValue in interface EnvironmentVariablespublic String getValue(Enum<?> property, String defaultValue)
getValue in interface EnvironmentVariablespublic List<String> getKeys()
getKeys in interface EnvironmentVariablespublic Properties getProperties()
getProperties in interface EnvironmentVariablespublic Properties getPropertiesWithPrefix(String prefix)
getPropertiesWithPrefix in interface EnvironmentVariablespublic boolean aValueIsDefinedFor(Enum<?> property)
aValueIsDefinedFor in interface EnvironmentVariablespublic boolean aValueIsDefinedFor(String property)
aValueIsDefinedFor in interface EnvironmentVariablespublic boolean hasPath(String path)
hasPath in interface EnvironmentVariablespublic String injectSystemPropertiesInto(String value)
injectSystemPropertiesInto in interface EnvironmentVariablespublic Integer getPropertyAsInteger(String property, Integer defaultValue)
getPropertyAsInteger in interface EnvironmentVariablespublic Integer getPropertyAsInteger(Enum<?> property, Integer defaultValue)
getPropertyAsInteger in interface EnvironmentVariablespublic Boolean getPropertyAsBoolean(String name, boolean defaultValue)
getPropertyAsBoolean in interface EnvironmentVariablespublic Boolean getPropertyAsBoolean(Enum<?> property, boolean defaultValue)
getPropertyAsBoolean in interface EnvironmentVariablespublic String getProperty(String name)
getProperty in interface EnvironmentVariablespublic Optional<String> optionalProperty(String name)
EnvironmentVariablesSample usage: ``` EnvironmentVariables environmentVariables;
String environment = environmentVariables.optionalProperty("env").orElse("DEV") ```
optionalProperty in interface EnvironmentVariablespublic String getProperty(Enum<?> property)
getProperty in interface EnvironmentVariablespublic String getProperty(String name, String defaultValue)
getProperty in interface EnvironmentVariablespublic String getProperty(Enum<?> property, String defaultValue)
getProperty in interface EnvironmentVariablespublic void setProperty(String name, String value)
setProperty in interface EnvironmentVariablespublic void setProperties(Map<String,String> properties)
setProperties in interface EnvironmentVariablespublic void clearProperty(String name)
clearProperty in interface EnvironmentVariablespublic Map<String,String> asMap()
asMap in interface EnvironmentVariablespublic Map<String,String> simpleSystemPropertiesAsMap()
simpleSystemPropertiesAsMap in interface EnvironmentVariablespublic void reset()
reset in interface EnvironmentVariablespublic static EnvironmentVariables createEnvironmentVariables()
public static EnvironmentVariables createEnvironmentVariables(Path configurationFile)
public static EnvironmentVariables createEnvironmentVariables(Path configurationFile, EnvironmentVariables environmentVariables)
public com.typesafe.config.Config getConfig(String prefix)
getConfig in interface EnvironmentVariablesCopyright © 2023. All rights reserved.