public class DefaultConfig extends AbstractConfig implements RepositoryChangeListener
| 构造器和说明 |
|---|
DefaultConfig(String executor,
ConfigRepository configRepository)
Constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getProperty(String key,
String defaultValue)
Return the property value with the given key, or
defaultValue if the key doesn't exist. |
Set<String> |
getPropertyNames()
Return a set of the property names
|
ConfigSourceType |
getSourceType()
Return the config's source type, i.e. where is the config loaded from
|
void |
onRepositoryChange(String executor,
Properties newProperties)
Invoked when config repository changes.
|
addChangeListener, addChangeListener, addChangeListener, getIntProperty, getLongProperty, getProperty, getShortProperty, removeChangeListenerpublic DefaultConfig(String executor, ConfigRepository configRepository)
executor - the executor of this config instanceconfigRepository - the config repository for this config instancepublic String getProperty(String key, String defaultValue)
ConfigdefaultValue if the key doesn't exist.getProperty 在接口中 Configkey - the property namedefaultValue - the default value when key is not found or any error occurredpublic Set<String> getPropertyNames()
ConfiggetPropertyNames 在接口中 Configpublic ConfigSourceType getSourceType()
ConfiggetSourceType 在接口中 Configpublic void onRepositoryChange(String executor, Properties newProperties)
RepositoryChangeListeneronRepositoryChange 在接口中 RepositoryChangeListenerexecutor - the executor of this repository changenewProperties - the properties after changeCopyright © 2022 hellothomas. All rights reserved.