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:

  1. the operating system's environment variables; for instance, an environment variable can be set with export EXAMPLE_CONFIG_KEY_NAME="foo"
  2. the Java system properties; for example, a Java system property can be set using System.setProperty("EXAMPLE_CONFIG_KEY_NAME", "foo")
  3. 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
Note that environment config has higher priority than Java system properties. Java system properties have higher priority than file based configuration.
  • 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

    Modifier and Type
    Method
    Description
    Example config definition.
  • Method Details

    • exampleConfigKey

      @Key("EXAMPLE_CONFIG_KEY_NAME") String exampleConfigKey()
      Example config definition.
      Returns:
      a config value as string.