Interface ApplicationConfig
- All Superinterfaces:
org.aeonbits.owner.Config
,Serializable
@Immutable
@ThreadSafe
@LoadPolicy(MERGE)
@Sources({"system:env","system:properties","classpath:application.properties"})
public interface ApplicationConfig
extends org.aeonbits.owner.Config
ApplicationConfig
provides an interface for retrieving configuration values, allowing for implicit type
conversion, defaulting, and use of a runtime properties interface to override configured settings.
ApplicationConfig
tries to load the configurations from several sources in the following order:
- the
operating system's environment variables; for instance, an environment variable can be set with
export EXAMPLE_CONFIG_KEY_NAME="foo"
- the
Java system properties; for example, a Java system property can
be set using
System.setProperty("EXAMPLE_CONFIG_KEY_NAME", "foo")
- a file named application.properties placed under CLASSPATH. This file can be put under
src/main/resources
source directory with contents, for example,EXAMPLE_CONFIG_KEY_NAME=foo
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aeonbits.owner.Config
org.aeonbits.owner.Config.ConverterClass, org.aeonbits.owner.Config.DecryptorClass, org.aeonbits.owner.Config.DefaultValue, org.aeonbits.owner.Config.DisableableFeature, org.aeonbits.owner.Config.DisableFeature, org.aeonbits.owner.Config.EncryptedValue, org.aeonbits.owner.Config.HotReload, org.aeonbits.owner.Config.HotReloadType, org.aeonbits.owner.Config.Key, org.aeonbits.owner.Config.LoadPolicy, org.aeonbits.owner.Config.LoadType, org.aeonbits.owner.Config.PreprocessorClasses, org.aeonbits.owner.Config.Separator, org.aeonbits.owner.Config.Sources, org.aeonbits.owner.Config.TokenizerClass
-
Method Summary
-
Method Details
-
exampleConfigKey
Example config definition.- Returns:
- a config value as string.
-