Class TigerConfigurationLoader
java.lang.Object
de.gematik.test.tiger.common.config.TigerConfigurationLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigurationSource(AbstractTigerConfigurationSource configurationSource) static Map<TigerConfigurationKey,String> addYamlToMap(Object value, TigerConfigurationKey baseKeys, Map<TigerConfigurationKey, String> valueMap) 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.<T> Optional<T>instantiateConfigurationBeanStrict(Class<T> configurationBeanClass, String... baseKeys) Instantiates a bean of the given class.voidvoidvoidvoidvoidputValue(String key, String value, SourceType sourceType) booleanreadBoolean(String key) booleanreadBoolean(String key, boolean defValue) voidreadFromYaml(String yamlSource, SourceType sourceType, String... baseKeys) voidreadFromYaml(String yamlSource, String... baseKeys) readMapWithCaseSensitiveKeys(String... baseKeys) readString(String key) readString(String key, String defaultValue) readStringOptional(String key) voidreadTemplates(String templatesYaml, String... baseKeys) booleanremoveConfigurationSource(AbstractTigerConfigurationSource configurationSource) voidreset()
-
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.
- Type Parameters:
T-- 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
-
instantiateConfigurationBeanStrict
public <T> Optional<T> instantiateConfigurationBeanStrict(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}) an empty value is returned. This behaviour follows the "fail fast, fail early" approach.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.
- Type Parameters:
T-- 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
-
readBoolean
-
readBoolean
-
readBooleanOptional
-
readTemplates
-
loadEnvironmentVariables
public void loadEnvironmentVariables() -
loadSystemProperties
public void loadSystemProperties() -
retrieveMap
-
addYamlToMap
public static Map<TigerConfigurationKey,String> addYamlToMap(Object value, TigerConfigurationKey baseKeys, Map<TigerConfigurationKey, String> valueMap) -
readMap
-
readMapWithCaseSensitiveKeys
-
listSources
-
putValue
-
putValue
-
putValue
-
addConfigurationSource
-
removeConfigurationSource
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-