class ConfigurationProvider
cangjie
public abstract class ConfigurationProvider <: IConfigurationProvider功能:提供基于键值存储的配置提供程序基类。
父类型:
成员概览
| 成员 | 功能 |
|---|---|
| func get(String) | 获取指定键对应的配置值。 |
| func set(String, ?String) | 设置指定键对应的配置值。 |
| func getChildKeys(Collection<String>, ?String) | 返回指定父路径下的子键集合。 |
| func load() | 加载或重新加载当前提供程序的数据。 |
func get(String)
cangjie
public open func get(key: String): ?String功能:获取指定键对应的配置值。
参数:
- key:
String- 配置项的键。
返回值:
?String- 返回对应的配置值;如果不存在则返回 None。
func set(String, ?String)
cangjie
public open func set(key: String, value: ?String): Unit功能:设置指定键对应的配置值。
参数:
- key:
String- 配置项的键。 - value:
?String- 要写入的配置值。
返回值:
Unit
func getChildKeys(Collection<String>, ?String)
cangjie
public open func getChildKeys(earlierKeys: Collection<String>, parentPath: ?String): Collection<String>功能:返回指定父路径下的子键集合。
参数:
- earlierKeys:
Collection<String>- 已收集的子键集合。 - parentPath:
?String- 父配置路径。
返回值:
Collection<String>- 返回当前提供程序可见的子键集合。
func load()
cangjie
public open func load(): Unit功能:加载或重新加载当前提供程序的数据。
返回值:
Unit