Class AbstractConfigSource

java.lang.Object
com.alipay.sofa.common.config.source.AbstractConfigSource
All Implemented Interfaces:
ConfigSource, Ordered
Direct Known Subclasses:
ConfigSourceCacheWrapper, SystemEnvConfigSource, SystemPropertyConfigSource

public abstract class AbstractConfigSource extends Object implements ConfigSource
Version:
: AbstractConfigSource.java, v 0.1 2020年10月21日 2:38 下午 zhaowang Exp $
Author:
zhaowang
  • Constructor Details

    • AbstractConfigSource

      public AbstractConfigSource()
  • Method Details

    • getConfig

      public <T> T getConfig(ConfigKey<T> key)
      Description copied from interface: ConfigSource
      Get config by configKey. If no value exists, return null or empty string
      Specified by:
      getConfig in interface ConfigSource
      Parameters:
      key - ConfigKey
      Returns:
      value of key
    • getStringConfig

      public String getStringConfig(ConfigKey key)
      Description copied from interface: ConfigSource
      Get the string value of key
      Specified by:
      getStringConfig in interface ConfigSource
      Parameters:
      key - ConfigKey
      Returns:
      string value of key
    • getEffectiveKey

      public String getEffectiveKey(ConfigKey configKey)
      Description copied from interface: ConfigSource
      The actual effective key to get the value.
      Specified by:
      getEffectiveKey in interface ConfigSource
      Parameters:
      configKey - ConfigKey
      Returns:
    • changeValueType

      protected <T> T changeValueType(String value, Class<T> targetType)
    • doGetConfig

      public abstract String doGetConfig(String key)
    • hasKey

      public abstract boolean hasKey(String key)