Package org.apache.dubbo.common.config
Interface Configuration
- All Known Subinterfaces:
DynamicConfiguration
- All Known Implementing Classes:
AbstractDynamicConfiguration,CompositeConfiguration,CompositeDynamicConfiguration,ConfigConfigurationAdapter,EnvironmentConfiguration,InmemoryConfiguration,NopDynamicConfiguration,OrderedPropertiesConfiguration,PrefixedConfiguration,PropertiesConfiguration,SystemConfiguration,TreePathDynamicConfiguration
public interface Configuration
Configuration interface, to fetch the value for the specified key.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancontainsKey(String key) Check if the configuration contains the specified key.default <T> Tdefault booleangetBoolean(String key) default booleangetBoolean(String key, boolean defaultValue) default BooleangetBoolean(String key, Boolean defaultValue) default intdefault intdefault IntegergetInteger(String key, Integer defaultValue) default ObjectgetProperty(String key) Gets a property from the configuration.default ObjectgetProperty(String key, Object defaultValue) Gets a property from the configuration.default StringGet a string associated with the given configuration key.default StringGet a string associated with the given configuration key.static BooleantoBooleanObject(boolean bool)
-
Field Details
-
interfaceLevelLogger
-
-
Method Details
-
getString
Get a string associated with the given configuration key.- Parameters:
key- The configuration key.- Returns:
- The associated string.
-
getString
Get a string associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.- Parameters:
key- The configuration key.defaultValue- The default value.- Returns:
- The associated string if key is found and has valid format, default value otherwise.
-
getInt
-
getInt
-
getInteger
-
getBoolean
-
getBoolean
-
getBoolean
-
getProperty
Gets a property from the configuration. This is the most basic get method for retrieving values of properties. In a typical implementation of theConfigurationinterface the other get methods (that return specific data types) will internally make use of this method. On this level variable substitution is not yet performed. The returned object is an internal representation of the property value for the passed in key. It is owned by theConfigurationobject. So a caller should not modify this object. It cannot be guaranteed that this object will stay constant over time (i.e. further update operations on the configuration may change its internal state).- Parameters:
key- property to retrieve- Returns:
- the value to which this configuration maps the specified key, or null if the configuration contains no mapping for this key.
-
getProperty
Gets a property from the configuration. The default value will return if the configuration doesn't contain the mapping for the specified key.- Parameters:
key- property to retrievedefaultValue- default value- Returns:
- the value to which this configuration maps the specified key, or default value if the configuration contains no mapping for this key.
-
getInternalProperty
-
containsKey
Check if the configuration contains the specified key.- Parameters:
key- the key whose presence in this configuration is to be tested- Returns:
trueif the configuration contains a value for this key,falseotherwise
-
convert
-
toBooleanObject
-