Class PrefixedConfig

java.lang.Object
io.smallrye.reactive.messaging.providers.impl.PrefixedConfig
All Implemented Interfaces:
org.eclipse.microprofile.config.Config

public class PrefixedConfig extends Object implements org.eclipse.microprofile.config.Config
Represents a configuration class that allows overriding specific properties for a connector. If a nested-channel is defined, property lookups will be in the following order
  1. If nested-channel is given try [prefix].[channel].[nested-channel].[property-key]
  2. If an override function is given for a property-key, calls it converts the return value
  3. Calls the ConnectorConfig base function
See Also:
  • Constructor Details

    • PrefixedConfig

      public PrefixedConfig(org.eclipse.microprofile.config.Config overall, String prefix)
  • Method Details

    • prefixed

      public static PrefixedConfig prefixed(String prefix, org.eclipse.microprofile.config.Config overall)
    • nestedChannelKey

      protected String nestedChannelKey(String keyName)
    • getValue

      public <T> T getValue(String propertyName, Class<T> propertyType)
      Specified by:
      getValue in interface org.eclipse.microprofile.config.Config
    • getOptionalValue

      public <T> Optional<T> getOptionalValue(String propertyName, Class<T> propertyType)
      Specified by:
      getOptionalValue in interface org.eclipse.microprofile.config.Config
    • getConfigValue

      public org.eclipse.microprofile.config.ConfigValue getConfigValue(String propertyName)
      Specified by:
      getConfigValue in interface org.eclipse.microprofile.config.Config
    • getPropertyNames

      public Iterable<String> getPropertyNames()
      Gets the lists of config keys for the given connector. Note that the list contains property names from the config and env variables. It includes keys from the connector config and channel config.
      Specified by:
      getPropertyNames in interface org.eclipse.microprofile.config.Config
      Returns:
      the list of keys
    • toAlpha

      protected String toAlpha(String key)
    • nameExists

      protected boolean nameExists(String name)
    • getConfigSources

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

      public <T> Optional<org.eclipse.microprofile.config.spi.Converter<T>> getConverter(Class<T> forType)
      Specified by:
      getConverter in interface org.eclipse.microprofile.config.Config
    • unwrap

      public <T> T unwrap(Class<T> type)
      Specified by:
      unwrap in interface org.eclipse.microprofile.config.Config