public class MockEnvironmentVariables extends Object implements EnvironmentVariables
Modifier | Constructor and Description |
---|---|
|
MockEnvironmentVariables() |
protected |
MockEnvironmentVariables(Properties properties) |
protected |
MockEnvironmentVariables(Properties properties,
Map<String,String> values) |
public 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 EnvironmentVariables
public String getValue(Enum<?> property)
getValue
in interface EnvironmentVariables
public String getValue(String name, String defaultValue)
getValue
in interface EnvironmentVariables
public String getValue(Enum<?> property, String defaultValue)
getValue
in interface EnvironmentVariables
public Integer getPropertyAsInteger(String name, Integer defaultValue)
getPropertyAsInteger
in interface EnvironmentVariables
public Integer getPropertyAsInteger(Enum<?> property, Integer defaultValue)
getPropertyAsInteger
in interface EnvironmentVariables
public Boolean getPropertyAsBoolean(String name, boolean defaultValue)
getPropertyAsBoolean
in interface EnvironmentVariables
public Boolean getPropertyAsBoolean(Enum<?> property, boolean defaultValue)
getPropertyAsBoolean
in interface EnvironmentVariables
public String getProperty(String name)
getProperty
in interface EnvironmentVariables
public Optional<String> optionalProperty(String name)
EnvironmentVariables
optionalProperty
in interface EnvironmentVariables
public String getProperty(Enum<?> property)
getProperty
in interface EnvironmentVariables
public String getProperty(String name, String defaultValue)
getProperty
in interface EnvironmentVariables
public String getProperty(Enum<?> property, String defaultValue)
getProperty
in interface EnvironmentVariables
public void setProperty(String name, String value)
setProperty
in interface EnvironmentVariables
public void setProperties(Map<String,String> newProperties)
setProperties
in interface EnvironmentVariables
public void clearProperty(String name)
clearProperty
in interface EnvironmentVariables
public EnvironmentVariables copy()
copy
in interface EnvironmentVariables
public List<String> getKeys()
getKeys
in interface EnvironmentVariables
public Properties getProperties()
getProperties
in interface EnvironmentVariables
public Properties getPropertiesWithPrefix(String prefix)
getPropertiesWithPrefix
in interface EnvironmentVariables
public boolean aValueIsDefinedFor(Enum<?> property)
aValueIsDefinedFor
in interface EnvironmentVariables
public boolean aValueIsDefinedFor(String property)
aValueIsDefinedFor
in interface EnvironmentVariables
public String injectSystemPropertiesInto(String value)
injectSystemPropertiesInto
in interface EnvironmentVariables
public Map<String,String> asMap()
asMap
in interface EnvironmentVariables
public Map<String,String> simpleSystemPropertiesAsMap()
simpleSystemPropertiesAsMap
in interface EnvironmentVariables
Copyright © 2022. All rights reserved.