Interface ConfigBuilder


public interface ConfigBuilder
Builder for manually creating an instance of a Config.
See Also:
  • Method Details

    • addDefaultSources

      ConfigBuilder addDefaultSources()
      Add the default config sources appearing on the builder's classpath including:
      1. System properties
      2. Environment properties
      3. /META-INF/microprofile-config.properties
      Returns:
      the ConfigBuilder with the default config sources
    • addDiscoveredSources

      ConfigBuilder addDiscoveredSources()
      Add the config sources appearing to be loaded via service loader pattern
      Returns:
      the ConfigBuilder with the autodiscovered config sources
    • addDiscoveredConverters

      ConfigBuilder addDiscoveredConverters()
      Add the converters to be loaded via service loader pattern
      Returns:
      the ConfigBuilder with the autodiscovered converters
    • forClassLoader

      ConfigBuilder forClassLoader(ClassLoader loader)
      Return the ConfigBuilder for a given classloader
      Parameters:
      loader - the specified classloader
      Returns:
      the ConfigureBuilder for the given classloader
    • withSources

      ConfigBuilder withSources(ConfigSource... sources)
      Add the specified ConfigSource.
      Parameters:
      sources - the config sources
      Returns:
      the ConfigBuilder with the configured sources
    • withConverters

      ConfigBuilder withConverters(Converter<?>... converters)
      Add the specified Converter. This method uses reflection to determine what type the converter is for. Custom converters should not be created as a lambda expression, as lambda expressions do not offer enough type information to the reflection API. Explicit implementation of a Converter interface is required for a custom converter.
      Parameters:
      converters - the converters
      Returns:
      the ConfigBuilder with the added converters
    • build

      Config build()
      Build the Config object.
      Returns:
      the Config object