public class MockEnvironmentVariables extends Object implements EnvironmentVariables
| Modifier | Constructor and Description |
|---|---|
|
MockEnvironmentVariables() |
protected |
MockEnvironmentVariables(Properties properties) |
protected |
MockEnvironmentVariables(Properties properties,
Map<String,String> values) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactiveEnvironmentspublic MockEnvironmentVariables()
protected MockEnvironmentVariables(Properties properties)
protected MockEnvironmentVariables(Properties properties, Map<String,String> values)
public static EnvironmentVariables fromSystemEnvironment()
public boolean propertySetIsEmpty()
public 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 Integer getPropertyAsInteger(String name, 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> newProperties)
setProperties in interface EnvironmentVariablespublic void clearProperty(String name)
clearProperty in interface EnvironmentVariablespublic EnvironmentVariables copy()
copy 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 Map<String,String> asMap()
asMap in interface EnvironmentVariablespublic Map<String,String> simpleSystemPropertiesAsMap()
simpleSystemPropertiesAsMap in interface EnvironmentVariablespublic void reset()
reset in interface EnvironmentVariablespublic void setConfig(com.typesafe.config.Config typesafeConfig)
setConfig in interface EnvironmentVariablespublic com.typesafe.config.Config getConfig(String prefix)
getConfig in interface EnvironmentVariablesCopyright © 2023. All rights reserved.