Class TigerConfigurationLoader
java.lang.Object
de.gematik.test.tiger.common.config.TigerConfigurationLoader
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigurationSource(TigerConfigurationSource configurationSource) com.fasterxml.jackson.databind.ObjectMappervoid<T> TinstantiateConfigurationBean(com.fasterxml.jackson.core.type.TypeReference<T> configurationBeanType, String... baseKeys) <T> Optional<T>instantiateConfigurationBean(Class<T> configurationBeanClass, String... baseKeys) Instantiates a bean of the given class.voidvoidvoidputValue(TigerConfigurationKey key, Object value, ConfigurationValuePrecedence precedence) voidvoidputValue(String key, Object value, ConfigurationValuePrecedence precedence) booleanreadBoolean(String key) booleanreadBoolean(String key, boolean defValue) voidreadConfigurationFile(String yamlSource, ConfigurationValuePrecedence precedence, ConfigurationFileType configurationFileType, String... baseKeys) voidreadFromYaml(String yamlSource, ConfigurationValuePrecedence precedence, String... baseKeys) voidreadFromYaml(String yamlSource, String... baseKeys) readMapWithCaseSensitiveKeys(String... baseKeys) readString(String key) readString(String key, String defaultValue) readStringOptional(String key) booleanremoveConfigurationSource(TigerConfigurationSource configurationSource) voidreset()retrieveMap(TigerConfigurationKey reference) Generates a map containing all key/value pairs.Generates a map containing all key/value pairs.
-
Field Details
-
TIGER_CONFIGURATION_ATTRIBUTE_KEY
- See Also:
-
-
Constructor Details
-
TigerConfigurationLoader
public TigerConfigurationLoader()
-
-
Method Details
-
reset
public void reset() -
initialize
public void initialize() -
readString
-
readString
-
readStringOptional
-
readStringOptional
-
instantiateConfigurationBean
public <T> Optional<T> instantiateConfigurationBean(Class<T> configurationBeanClass, String... baseKeys) Instantiates a bean of the given class. The base-keys denote the point from which the keys are taken. If values can not be substituted (e.g. ${key.that.does.not.exist}) they are simply returned as a string. This behaviour is more relaxed towards input errors but might delay failures from startup to runtime.If the base-keys lead to a non-defined (i.e. empty) node in the tree (no values have been read) an empty optional is returned.
- Parameters:
configurationBeanClass- The class of the configuration beanbaseKeys- Where in the configuration tree should the values be taken from?- Returns:
- An instance of configurationBeanClass filled with values taken from the configuration tree
-
instantiateConfigurationBean
public <T> T instantiateConfigurationBean(com.fasterxml.jackson.core.type.TypeReference<T> configurationBeanType, String... baseKeys) -
readFromYaml
-
readFromYaml
public void readFromYaml(String yamlSource, ConfigurationValuePrecedence precedence, String... baseKeys) -
readConfigurationFile
public void readConfigurationFile(String yamlSource, ConfigurationValuePrecedence precedence, ConfigurationFileType configurationFileType, String... baseKeys) -
readBoolean
-
readBoolean
-
readBooleanOptional
-
loadEnvironmentVariables
public void loadEnvironmentVariables() -
loadSystemProperties
public void loadSystemProperties() -
retrieveMap
Generates a map containing all key/value pairs. All placeholders below the reference in the values are resolved. -
retrieveMapUnresolved
Generates a map containing all key/value pairs. Placeholders in the values are NOT resolved. -
readMap
-
readList
-
readMapWithCaseSensitiveKeys
-
readMapWithCaseSensitiveKeys
-
listSources
-
putValue
-
putValue
-
putValue
public void putValue(TigerConfigurationKey key, Object value, ConfigurationValuePrecedence precedence) -
addConfigurationSource
-
removeConfigurationSource
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-