Interface Config

All Superinterfaces:
org.eclipse.microprofile.config.Config
All Known Implementing Classes:
SmallRyeConfig

public interface Config extends org.eclipse.microprofile.config.Config
Config provides a way to retrieve configuration values from a configuration name.

A Config instance is obtained via the SmallRyeConfigBuilder.build(), or by calling the static methods getOrCreate(), getOrCreate(ClassLoader), get() or get(ClassLoader), which details how Config will behave. Generally, a Config instance is composed of:

  • Configuration Sources to lookup the configuration values
  • Converters to convert values to specific types
  • Interceptors to enhance the configuration lookup process
  • ConfigMapping Config Mappings classes to group multiple configuration values in a common prefix
  • Field Summary

    Fields inherited from interface org.eclipse.microprofile.config.Config

    PROFILE, PROPERTY_EXPRESSIONS_ENABLED
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    convertValue(ConfigValue configValue, org.eclipse.microprofile.config.spi.Converter<T> converter)
    Returns the value for the specified ConfigValue, converting the value using the specified Converter.
    static Config
    get()
    Get a SmallRyeConfig instance for the current Thread.getContextClassLoader().
    static Config
    get(ClassLoader classLoader)
    Get a SmallRyeConfig instance for the specified ClassLoader.
    <T> T
    Returns an instance of a ConfigMapping annotated type, mapping all the configuration names matching the ConfigMapping.prefix() and the ConfigMapping members to values from the underlying configuration sources.
    <T> T
    getConfigMapping(Class<T> type, String prefix)
    Returns an instance of a ConfigMapping annotated type, mapping all the configuration names matching the prefix and the ConfigMapping members to values from the underlying configuration sources.
    Optional<org.eclipse.microprofile.config.spi.ConfigSource>
    Return the first registered configuration sources in SmallRyeConfig that match the specified name, sorted by descending ordinal value and name.
    Iterable<org.eclipse.microprofile.config.spi.ConfigSource>
    Iterable<org.eclipse.microprofile.config.spi.ConfigSource>
    Return the currently registered configuration sources in SmallRyeConfig that match the specified type.
    Returns the ConfigValue for the specified configuration name from the underlying configuration sources.
    Provides a way to retrieve an updated list of all property names.
    <T> Optional<T>
    getOptionalValue(String name, Class<T> propertyType)
    Returns the value for the specified configuration name from the underlying configuration sources.
    <T> Optional<T>
    getOptionalValue(String name, org.eclipse.microprofile.config.spi.Converter<T> converter)
    Returns the value for the specified configuration name from the underlying configuration sources.
    <K, V> Optional<Map<K,V>>
    getOptionalValues(String name, Class<K> keyClass, Class<V> valueClass)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <K, V, C extends Collection<V>>
    Optional<Map<K,C>>
    getOptionalValues(String name, Class<K> keyClass, Class<V> valueClass, IntFunction<C> collectionFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <T> Optional<List<T>>
    getOptionalValues(String name, Class<T> propertyType)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <T, C extends Collection<T>>
    Optional<C>
    getOptionalValues(String name, Class<T> itemClass, IntFunction<C> collectionFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <K, V> Optional<Map<K,V>>
    getOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <K, V, C extends Collection<V>>
    Optional<Map<K,C>>
    getOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter, IntFunction<Map<K,C>> mapFactory, IntFunction<C> collectionFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <K, V> Optional<Map<K,V>>
    getOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter, IntFunction<Map<K,V>> mapFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <T, C extends Collection<T>>
    Optional<C>
    getOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<T> converter, IntFunction<C> collectionFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    static Config
    Get or Create a SmallRyeConfig instance for the current Thread.getContextClassLoader().
    static Config
    getOrCreate(ClassLoader classLoader)
    Get or Create a SmallRyeConfig instance for the specified ClassLoader.
    Returns a List of the active profiles in SmallRyeConfig.
    This implementation caches the list of property names collected when SmallRyeConfig is built via SmallRyeConfigBuilder.build().
    <T> T
    getValue(String name, Class<T> propertyType)
    Returns the value for the specified configuration name from the underlying configuration sources.
    <T> T
    getValue(String name, org.eclipse.microprofile.config.spi.Converter<T> converter)
    Returns the value for the specified configuration name from the underlying configuration sources.
    <K, V> Map<K,V>
    getValues(String name, Class<K> keyClass, Class<V> valueClass)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <K, V, C extends Collection<V>>
    Map<K,C>
    getValues(String name, Class<K> keyClass, Class<V> valueClass, IntFunction<C> collectionFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <T> List<T>
    getValues(String name, Class<T> propertyType)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <T, C extends Collection<T>>
    C
    getValues(String name, Class<T> itemClass, IntFunction<C> collectionFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <K, V> Map<K,V>
    getValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <K, V, C extends Collection<V>>
    Map<K,C>
    getValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter, IntFunction<Map<K,C>> mapFactory, IntFunction<C> collectionFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <K, V> Map<K,V>
    getValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter, IntFunction<Map<K,V>> mapFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    <T, C extends Collection<T>>
    C
    getValues(String name, org.eclipse.microprofile.config.spi.Converter<T> converter, IntFunction<C> collectionFactory)
    Returns the values for the specified configuration name from the underlying configuration sources.
    boolean
    Checks if a property is present in the Config instance.
    <T> org.eclipse.microprofile.config.spi.Converter<T>
    Return the Converter used by this instance to produce instances of the specified type from String values.

    Methods inherited from interface org.eclipse.microprofile.config.Config

    getConverter, unwrap
  • Method Details

    • getValues

      <T> List<T> getValues(String name, Class<T> propertyType)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning List converted to their specified property type. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in a List with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in a List with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Specified by:
      getValues in interface org.eclipse.microprofile.config.Config
      Type Parameters:
      T - the item type
      Parameters:
      name - The configuration property name to look for in the configuration
      propertyType - The type into which the resolved property values are converted
      Returns:
      the resolved property values as a List of instances of the property type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getValues

      <T, C extends Collection<T>> C getValues(String name, Class<T> itemClass, IntFunction<C> collectionFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning Collection converted to their specified property type. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in a Collection with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in a Collection with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      T - the item type
      C - the collection type
      Parameters:
      name - The configuration property name to look for in the configuration
      itemClass - The type into which the resolved property values are converted
      collectionFactory - the resulting instance of a Collection to return the property values
      Returns:
      the resolved property values as a Collection of instances of the property type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getValues

      <T, C extends Collection<T>> C getValues(String name, org.eclipse.microprofile.config.spi.Converter<T> converter, IntFunction<C> collectionFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning Collection converted by the specified Converter. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in a Collection with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in a Collection with the elements dog, cat, and turtle, considering the configuration name as my.property and the Converter to convert the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      T - the item type
      C - the collection type
      Parameters:
      name - The configuration property name to look for in the configuration
      converter - The Converter to use to convert the resolved property values
      collectionFactory - the resulting instance of a Collection to return the property values
      Returns:
      the resolved property values as a Collection of instances of the property type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getValues

      <K, V> Map<K,V> getValues(String name, Class<K> keyClass, Class<V> valueClass)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed properties. A keyed property uses the original property name plus an additional dotted segment to represent a Map key, as my.property.key, where my.property is the property name and key is the Map key. All keyed properties are queried for their values, which represent a single entry in the returning Map converting both the key and value to their specified types. The following configuration:

      • server.reasons.200=OK
      • server.reasons.201=CREATED
      • server.reasons.404=NOT_FOUND

      Results in a Map with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons, the key type as Integer and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; with the backslash (\) as the escape character. A configuration of server.reasons=200=OK;201=CREATED;404=NOT_FOUND results in a Map with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons, the key type as Integer and the property type as a String.

      The keyed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyClass - The type into which the resolved property keys are converted
      valueClass - The type into which the resolved property values are converted
      Returns:
      the resolved property values as a Map of keys of the property name and values of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getValues

      <K, V> Map<K,V> getValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed properties. A keyed property uses the original property name plus an additional dotted segment to represent a Map key, as my.property.key, where my.property is the property name and key is the Map key. All keyed properties are queried for their values, which represent a single entry in the returning Map converting both the key and value using the specified Converters. The following configuration:

      • server.reasons.200=OK
      • server.reasons.201=CREATED
      • server.reasons.404=NOT_FOUND

      Results in a Map with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons and Converters to convert the key type as an Integer and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; with the backslash (\) as the escape character. A configuration of server.reasons=200=OK;201=CREATED;404=NOT_FOUND results in a Map with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons and Converters to convert the key type as an Integer and the property type as a String.

      The keyed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyConverter - The Converter to use to convert the resolved property keys
      valueConverter - The Converter to use to convert the resolved property values
      Returns:
      the resolved property values as a Map of keys of the property name and values of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getValues

      <K, V> Map<K,V> getValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter, IntFunction<Map<K,V>> mapFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed properties. A keyed property uses the original property name plus an additional dotted segment to represent a Map key, as my.property.key, where my.property is the property name and key is the Map key. All keyed properties are queried for their values, which represent a single entry in the returning Map converting both the key and value using the specified Converters. The following configuration:

      • server.reasons.200=OK
      • server.reasons.201=CREATED
      • server.reasons.404=NOT_FOUND

      Results in a Map with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons and Converters to convert the key type as an Integer and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; with the backslash (\) as the escape character. A configuration of server.reasons=200=OK;201=CREATED;404=NOT_FOUND results in a Map with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons and Converters to convert the key type as an Integer and the property type as a String.

      The keyed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyConverter - The Converter to use to convert the resolved property keys
      valueConverter - The Converter to use to convert the resolved property values
      mapFactory - the resulting instance of a Map to return the property keys and values
      Returns:
      the resolved property values as a Map of keys of the property name and values of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getValues

      <K, V, C extends Collection<V>> Map<K,C> getValues(String name, Class<K> keyClass, Class<V> valueClass, IntFunction<C> collectionFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed indexed properties. A keyed indexed property uses the original property name plus an additional dotted segment to represent a Map key followed by square brackets and an index in between, as my.property.key[0], where my.property is the property name, key is the Map key and {code [0]} the index of the Collection element. All keyed indexed properties are queried for their value, which represent a single entry in the returning Map, and single element in the Collection value, converting both the key and value to their specified types. The following configuration:

      • server.env.prod[0]=alpha
      • server.env.prod[1]=beta
      • server.env.dev[0]=local

      Results in a Map with the entry key prod and entry value Collection with the values alpha and beta, and the entry key dev and entry value Collection with the value local, considering the configuration name as server.env, the key type as a String, and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; and value as a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of server.env=prod=alpha,beta;dev=local results in a Map with the entry key prod and entry value Collection with the values alpha and beta, and the entry key dev and entry value Collection with the value local, considering the configuration name as server.env, the key type as a String, and the property type as a String.

      The keyed indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      C - the collection type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyClass - The type into which the resolved property keys are converted
      valueClass - The type into which the resolved property values are converted
      collectionFactory - the resulting instance of a Collection to return the property values
      Returns:
      the resolved property values as a Map of keys of the property name and values as a Collections of instances of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getValues

      <K, V, C extends Collection<V>> Map<K,C> getValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter, IntFunction<Map<K,C>> mapFactory, IntFunction<C> collectionFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed indexed properties. A keyed indexed property uses the original property name plus an additional dotted segment to represent a Map key followed by square brackets and an index in between, as my.property.key[0], where my.property is the property name, key is the Map key and {code [0]} the index of the Collection element. All keyed indexed properties are queried for their value, which represent a single entry in the returning Map, and single element in the Collection value, converting both the key and value using the specified Converters. The following configuration:

      • server.env.prod[0]=alpha
      • server.env.prod[1]=beta
      • server.env.dev[0]=local

      Results in a Map with the entry key prod and entry value Collection with the values alpha and beta, and the entry key dev and entry value Collection with the value local, considering the configuration name as server.env and Converters to convert the key type as a String and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; and value as a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of server.env=prod=alpha,beta;dev=local results in a Map with the entry key prod and entry value Collection with the values alpha and beta, and the entry key dev and entry value Collection with the value local, considering the configuration name as server.env, and Converters to convert the key type as a String and the property type as a String.

      The keyed indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      C - the collection type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyConverter - The Converter to use to convert the resolved property keys
      valueConverter - The Converter to use to convert the resolved property values
      mapFactory - the resulting instance of a Map to return the property keys and values
      collectionFactory - the resulting instance of a Collection to return the property values
      Returns:
      the resolved property values as a Map of keys of the property name and values as a Collections of instances of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getValue

      <T> T getValue(String name, Class<T> propertyType)
      Returns the value for the specified configuration name from the underlying configuration sources.

      If the requested type is a type array, the lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning type array converted to their specified property type. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in an array with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in an array with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Specified by:
      getValue in interface org.eclipse.microprofile.config.Config
      Type Parameters:
      T - the property type
      Parameters:
      name - The configuration property name to look for in the configuration
      propertyType - The type into which the resolved property value is converted
      Returns:
      the resolved property value as an instance of the property type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getValue

      <T> T getValue(String name, org.eclipse.microprofile.config.spi.Converter<T> converter)
      Returns the value for the specified configuration name from the underlying configuration sources.

      If the requested type is a type array, the lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning type array converted by the specified Converter. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in an array with the elements dog, cat, and turtle, considering the configuration name as my.property and the Converter to convert the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in an array with the elements dog, cat, and turtle, considering the configuration name as my.property and the Converter to convert the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      T - the property type
      Parameters:
      name - The configuration property name to look for in the configuration
      converter - The Converter to use to convert the resolved property value
      Returns:
      the resolved property value as an instance of the converter type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • convertValue

      <T> T convertValue(ConfigValue configValue, org.eclipse.microprofile.config.spi.Converter<T> converter)
      Returns the value for the specified ConfigValue, converting the value using the specified Converter.
      Type Parameters:
      T - the property type
      Parameters:
      configValue - a ConfigValue with the value to convert
      converter - The Converter to use to convert the resolved property value
      Returns:
      the resolved property value as an instance of the converter type
    • getConfigValue

      ConfigValue getConfigValue(String name)
      Returns the ConfigValue for the specified configuration name from the underlying configuration sources.

      The lookup of the configuration is performed immediately, meaning that calls to ConfigValue will always yield the same results.

      A ConfigValue is always returned even if a property name cannot be found. In this case, every method in ConfigValue returns null, or the default value for primitive types, except for ConfigValue.getName(), which includes the original property name being looked up.

      Specified by:
      getConfigValue in interface org.eclipse.microprofile.config.Config
      Parameters:
      name - The configuration property name to look for in the configuration
      Returns:
      the resolved property value as a ConfigValue
    • getOptionalValue

      <T> Optional<T> getOptionalValue(String name, Class<T> propertyType)
      Returns the value for the specified configuration name from the underlying configuration sources.

      If the requested type is a type array, the lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning type array converted to their specified property type. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in an array with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in an array with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Specified by:
      getOptionalValue in interface org.eclipse.microprofile.config.Config
      Type Parameters:
      T - the property type
      Parameters:
      name - The configuration property name to look for in the configuration
      propertyType - The type into which the resolved property value is converted
      Returns:
      the resolved property value as a Optional instance of the property type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      See Also:
    • getOptionalValue

      <T> Optional<T> getOptionalValue(String name, org.eclipse.microprofile.config.spi.Converter<T> converter)
      Returns the value for the specified configuration name from the underlying configuration sources.

      If the requested type is a type array, the lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning type array converted by the specified Converter. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in an array with the elements dog, cat, and turtle, considering the configuration name as my.property and the Converter to convert the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in an array with the elements dog, cat, and turtle, considering the configuration name as my.property and the Converter to convert the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      T - the property type
      Parameters:
      name - The configuration property name to look for in the configuration
      converter - The Converter to use to convert the resolved property value
      Returns:
      the resolved property value as a Optional instance of the property type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      See Also:
    • getOptionalValues

      <T> Optional<List<T>> getOptionalValues(String name, Class<T> propertyType)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning Optional<List> converted to their specified property type. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in an Optional<List> with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in a Optional<List> with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Specified by:
      getOptionalValues in interface org.eclipse.microprofile.config.Config
      Type Parameters:
      T - the item type
      Parameters:
      name - The configuration property name to look for in the configuration
      propertyType - The type into which the resolved property values are converted
      Returns:
      the resolved property values as a Optional<List> of instances of the property type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      See Also:
    • getOptionalValues

      <T, C extends Collection<T>> Optional<C> getOptionalValues(String name, Class<T> itemClass, IntFunction<C> collectionFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning Optional<Collection> converted to their specified property type. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in a Optional<Collection> with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in a Optional<Collection> with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      T - the item type
      C - the collection type
      Parameters:
      name - The configuration property name to look for in the configuration
      itemClass - The type into which the resolved property values are converted
      collectionFactory - the resulting instance of a Collection to return the property values
      Returns:
      the resolved property values as a Optional<Collection> of instances of the property type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getOptionalValues

      <T, C extends Collection<T>> Optional<C> getOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<T> converter, IntFunction<C> collectionFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for indexed properties. An indexed property uses the original property name with square brackets and an index in between, as my.property[0]. All indexed properties are queried for their value, which represents a single element in the returning Optional<Collection> converted by the specified Converter. The following configuration:

      • my.property[0]=dog
      • my.property[1]=cat
      • my.property[2]=turtle

      Results in a Optional<Collection> with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      Otherwise, the configuration value is a single element that a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of my.property=dog,cat,turtle results in a Optional<Collection> with the elements dog, cat, and turtle, considering the configuration name as my.property and the property type as a String.

      The indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      T - the item type
      C - the collection type
      Parameters:
      name - The configuration property name to look for in the configuration
      converter - The Converter to use to convert the resolved property values
      collectionFactory - the resulting instance of a Collection to return the property values
      Returns:
      the resolved property values as a Optional<Collection> of instances of the property type
      Throws:
      IllegalArgumentException - if the property values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getOptionalValues

      <K, V> Optional<Map<K,V>> getOptionalValues(String name, Class<K> keyClass, Class<V> valueClass)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed properties. A keyed property uses the original property name plus an additional dotted segment to represent a Map key, as my.property.key, where my.property is the property name and key is the Map key. All keyed properties are queried for their values, which represent a single entry in the returning Optional<Map> converting both the key and value to their specified types. The following configuration:

      • server.reasons.200=OK
      • server.reasons.201=CREATED
      • server.reasons.404=NOT_FOUND

      Results in a Optional<Map> with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons, the key type as Integer and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; with the backslash (\) as the escape character. A configuration of server.reasons=200=OK;201=CREATED;404=NOT_FOUND results in a Optional<Map> with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons, the key type as Integer and the property type as a String.

      The keyed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyClass - The type into which the resolved property keys are converted
      valueClass - The type into which the resolved property values are converted
      Returns:
      the resolved property values as a Optional<Map> of keys of the property name and values of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getOptionalValues

      <K, V> Optional<Map<K,V>> getOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed properties. A keyed property uses the original property name plus an additional dotted segment to represent a Map key, as my.property.key, where my.property is the property name and key is the Map key. All keyed properties are queried for their values, which represent a single entry in the returning Optional<Map> converting both the key and value using the specified Converters. The following configuration:

      • server.reasons.200=OK
      • server.reasons.201=CREATED
      • server.reasons.404=NOT_FOUND

      Results in a Optional<Map> with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons and Converters to convert the key type as an Integer and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; with the backslash (\) as the escape character. A configuration of server.reasons=200=OK;201=CREATED;404=NOT_FOUND results in a Optional<Map> with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons and Converters to convert the key type as an Integer and the property type as a String.

      The keyed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyConverter - The Converter to use to convert the resolved property keys
      valueConverter - The Converter to use to convert the resolved property values
      Returns:
      the resolved property values as a Optional<Map> of keys of the property name and values of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getOptionalValues

      <K, V> Optional<Map<K,V>> getOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter, IntFunction<Map<K,V>> mapFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed properties. A keyed property uses the original property name plus an additional dotted segment to represent a Map key, as my.property.key, where my.property is the property name and key is the Map key. All keyed properties are queried for their values, which represent a single entry in the returning Optional<Map> converting both the key and value using the specified Converters. The following configuration:

      • server.reasons.200=OK
      • server.reasons.201=CREATED
      • server.reasons.404=NOT_FOUND

      Results in a Optional<Map> with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons and Converters to convert the key type as an Integer and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; with the backslash (\) as the escape character. A configuration of server.reasons=200=OK;201=CREATED;404=NOT_FOUND results in a Optional<Map> with the entries 200=OK, 201=CREATED, and 404=NOT_FOUND, considering the configuration name as server.reasons and Converters to convert the key type as an Integer and the property type as a String.

      The keyed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyConverter - The Converter to use to convert the resolved property keys
      valueConverter - The Converter to use to convert the resolved property values
      mapFactory - the resulting instance of a Map to return the property keys and values
      Returns:
      the resolved property values as a Optional<Map> of keys of the property name and values of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      NoSuchElementException - if the property isn't present in the configuration or is defined as an empty string, or the converter returns null
      See Also:
    • getOptionalValues

      <K, V, C extends Collection<V>> Optional<Map<K,C>> getOptionalValues(String name, Class<K> keyClass, Class<V> valueClass, IntFunction<C> collectionFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed indexed properties. A keyed indexed property uses the original property name plus an additional dotted segment to represent a Map key followed by square brackets and an index in between, as my.property.key[0], where my.property is the property name, key is the Map key and {code [0]} the index of the Collection element. All keyed indexed properties are queried for their value, which represent a single entry in the returning Optional<Map>, and single element in the Collection value, converting both the key and value to their specified types. The following configuration:

      • server.env.prod[0]=alpha
      • server.env.prod[1]=beta
      • server.env.dev[0]=local

      Results in a Optional<Map> with the entry key prod and entry value Collection with the values alpha and beta, and the entry key dev and entry value Collection with the value local, considering the configuration name as server.env, the key type as a String, and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; and value as a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of server.env=prod=alpha,beta;dev=local results in a Optional<Map> with the entry key prod and entry value Collection with the values alpha and beta, and the entry key dev and entry value Collection with the value local, considering the configuration name as server.env, the key type as a String, and the property type as a String.

      The keyed indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      C - the collection type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyClass - The type into which the resolved property keys are converted
      valueClass - The type into which the resolved property values are converted
      collectionFactory - the resulting instance of a Collection to return the property values
      Returns:
      the resolved property values as a Optional<Map> of keys of the property name and values as a Collections of instances of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      See Also:
    • getOptionalValues

      <K, V, C extends Collection<V>> Optional<Map<K,C>> getOptionalValues(String name, org.eclipse.microprofile.config.spi.Converter<K> keyConverter, org.eclipse.microprofile.config.spi.Converter<V> valueConverter, IntFunction<Map<K,C>> mapFactory, IntFunction<C> collectionFactory)
      Returns the values for the specified configuration name from the underlying configuration sources.

      The lookup to the configuration will first query getPropertyNames() for keyed indexed properties. A keyed indexed property uses the original property name plus an additional dotted segment to represent a Map key followed by square brackets and an index in between, as my.property.key[0], where my.property is the property name, key is the Map key and {code [0]} the index of the Collection element. All keyed indexed properties are queried for their value, which represent a single entry in the returning Optional<Map>, and single element in the Collection value, converting both the key and value using the specified Converters. The following configuration:

      • server.env.prod[0]=alpha
      • server.env.prod[1]=beta
      • server.env.dev[0]=local

      Results in a Optional<Map> with the entry key prod and entry value Collection with the values alpha and beta, and the entry key dev and entry value Collection with the value local, considering the configuration name as server.env and Converters to convert the key type as a String and the property type as a String.

      Otherwise, the configuration value is a single element represented by key value pairs as <key1>=<value1>;<key2>=<value2>... separated by a semicolon ; and value as a comma-separated string (,) can represent, and split into multiple elements with the backslash (\) as the escape character. A configuration of server.env=prod=alpha,beta;dev=local results in a Optional<Map> with the entry key prod and entry value Collection with the values alpha and beta, and the entry key dev and entry value Collection with the value local, considering the configuration name as server.env, and Converters to convert the key type as a String and the property type as a String.

      The keyed indexed property format has priority when both styles are found in the same configuration source. When available in multiple sources, the higher ordinal source wins, like any other configuration lookup.

      Type Parameters:
      K - the key type
      V - the value type
      C - the collection type
      Parameters:
      name - The configuration property name to look for in the configuration
      keyConverter - The Converter to use to convert the resolved property keys
      valueConverter - The Converter to use to convert the resolved property values
      mapFactory - the resulting instance of a Map to return the property keys and values
      collectionFactory - the resulting instance of a Collection to return the property values
      Returns:
      the resolved property values as a Optional<Map> of keys of the property name and values as a Collections of instances of the property type
      Throws:
      IllegalArgumentException - if the property keys or values cannot be converted to the specified type
      See Also:
    • getConfigMapping

      <T> T getConfigMapping(Class<T> type)
      Returns an instance of a ConfigMapping annotated type, mapping all the configuration names matching the ConfigMapping.prefix() and the ConfigMapping members to values from the underlying configuration sources.

      ConfigMapping instances are cached. They are populated when the SmallRyeConfig instance is initialized and their values are not updated on configuration sources changes.

      Type Parameters:
      T - the type of the ConfigMapping
      Parameters:
      type - an interface annotated with ConfigMapping
      Returns:
      an instance of a ConfigMapping annotated type
      Throws:
      ConfigValidationException - if the mapping names or values cannot be converter to the specified types, if the properties values are not present, defined as an empty string, or the conversion returns null
      See Also:
    • getConfigMapping

      <T> T getConfigMapping(Class<T> type, String prefix)
      Returns an instance of a ConfigMapping annotated type, mapping all the configuration names matching the prefix and the ConfigMapping members to values from the underlying configuration sources.

      ConfigMapping instances are cached. They are populated when the SmallRyeConfig instance is initialized and their values are not updated on configuration sources changes.

      Type Parameters:
      T - the type of the ConfigMapping
      Parameters:
      type - an interface annotated with ConfigMapping
      prefix - the prefix to override ConfigMapping.prefix()
      Returns:
      an instance of a ConfigMapping annotated type
      Throws:
      ConfigValidationException - if the mapping names or values cannot be converter to the specified types, if the properties values are not present, defined as an empty string, or the conversion returns null
      See Also:
    • getPropertyNames

      Iterable<String> getPropertyNames()
      This implementation caches the list of property names collected when SmallRyeConfig is built via SmallRyeConfigBuilder.build(). The cache may be disabled with SmallRyeConfigBuilder.isCachePropertyNames().
      Specified by:
      getPropertyNames in interface org.eclipse.microprofile.config.Config
      Returns:
      the cached names of all configured keys of the underlying configuration
      See Also:
    • getLatestPropertyNames

      Iterable<String> getLatestPropertyNames()
      Provides a way to retrieve an updated list of all property names. The updated list replaces the cached list returned by SmallRyeConfig.getPropertyNames().
      Returns:
      the names of all configured keys of the underlying configuration
    • isPropertyPresent

      boolean isPropertyPresent(String name)
      Checks if a property is present in the Config instance.
      Because ConfigSource.getPropertyNames() may not include all available properties, it is not possible to reliably determine if the property is present in the properties list. The property needs to be retrieved to make sure it exists. The lookup is done without expression expansion, because the expansion value may not be available, and it is not relevant for the final check.
      Parameters:
      name - the property name.
      Returns:
      true if the property is present or false otherwise.
    • getConfigSources

      Iterable<org.eclipse.microprofile.config.spi.ConfigSource> getConfigSources()
      Specified by:
      getConfigSources in interface org.eclipse.microprofile.config.Config
    • getConfigSources

      Iterable<org.eclipse.microprofile.config.spi.ConfigSource> getConfigSources(Class<?> type)
      Return the currently registered configuration sources in SmallRyeConfig that match the specified type.

      The returned sources will be sorted by descending ordinal value and name, which can be iterated in a thread-safe manner. The Iterable contains a fixed number of configuration sources, determined at configuration initialization, and the config sources themselves may be static or dynamic.

      Parameters:
      type - The type of the ConfigSource to look for in the configuration
      Returns:
      an Iterable of configuration sources
    • getConfigSource

      Optional<org.eclipse.microprofile.config.spi.ConfigSource> getConfigSource(String name)
      Return the first registered configuration sources in SmallRyeConfig that match the specified name, sorted by descending ordinal value and name.
      Parameters:
      name - the {ConfigSource name to look for in the configuration
      Returns:
      an Optional of a ConfigSource, or an empty Optional if no ConfigSource matches the specified name.
    • requireConverter

      <T> org.eclipse.microprofile.config.spi.Converter<T> requireConverter(Class<T> asType)
      Return the Converter used by this instance to produce instances of the specified type from String values.
      Type Parameters:
      T - the conversion type
      Parameters:
      asType - the type to be produced by the converter
      Returns:
      an instance of the Converter the specified type
      Throws:
      IllegalArgumentException - if no Converter is registered for the specified type
    • getProfiles

      List<String> getProfiles()
      Returns a List of the active profiles in SmallRyeConfig.

      Profiles are sorted in reverse order according to how they were set in SmallRyeConfig.SMALLRYE_CONFIG_PROFILE, as the last profile overrides the previous one until there are no profiles left in the list.

      Returns:
      a List of the active profiles
    • get

      static Config get()
      Get a SmallRyeConfig instance for the current Thread.getContextClassLoader().
      Returns:
      the SmallRyeConfig instance for the thread context class loader
      Throws:
      IllegalArgumentException - if the config is not registered for the thread context class loader
      IllegalArgumentException - if the registered config is not a SmallRyeConfig
    • getOrCreate

      static Config getOrCreate()
      Get or Create a SmallRyeConfig instance for the current Thread.getContextClassLoader().

      The SmallRyeConfig instance will be created and registered to the context classloader if no such configuration is already created and registered.

      Returns:
      the SmallRyeConfig instance for the thread context class loader
      Throws:
      IllegalArgumentException - if the registered config is not a SmallRyeConfig
    • get

      static Config get(ClassLoader classLoader)
      Get a SmallRyeConfig instance for the specified ClassLoader.
      Returns:
      the SmallRyeConfig instance for the specified class loader
      Throws:
      IllegalArgumentException - if the config is not registered for the thread context class loader
      IllegalArgumentException - if the registered config is not a SmallRyeConfig
    • getOrCreate

      static Config getOrCreate(ClassLoader classLoader)
      Get or Create a SmallRyeConfig instance for the specified ClassLoader.

      The SmallRyeConfig instance will be created and registered to the specified class loader if no such configuration is already created and registered.

      Returns:
      the SmallRyeConfig instance for the specified class loader
      Throws:
      IllegalArgumentException - if the registered config is not a SmallRyeConfig