add method

This commit is contained in:
Looly 2020-03-16 20:33:27 +08:00
parent a39a3bb841
commit f4cdfeed1d
3 changed files with 10 additions and 6 deletions

View File

@ -6,6 +6,7 @@
## 5.2.4
### 新特性
* 【setting】 Setting中增加addSetting和autoLoad重载issue#104@Gitee
### Bug修复

View File

@ -226,6 +226,7 @@ public class GroupedMap extends LinkedHashMap<String, LinkedHashMap<String, Stri
return this;
}
@SuppressWarnings("NullableProblems")
@Override
public Set<String> keySet() {
readLock.lock();
@ -276,6 +277,7 @@ public class GroupedMap extends LinkedHashMap<String, LinkedHashMap<String, Stri
return Collections.emptyList();
}
@SuppressWarnings("NullableProblems")
@Override
public Set<java.util.Map.Entry<String, LinkedHashMap<String, String>>> entrySet() {
readLock.lock();

View File

@ -194,14 +194,14 @@ public class Setting extends AbsSetting implements Map<String, String> {
public void autoLoad(boolean autoReload) {
autoLoad(autoReload, null);
}
/**
* 在配置文件变更时自动加载
*
*
* @param callback 加载完成回调
* @param autoReload 是否自动加载
*/
public void autoLoad(boolean autoReload,Consumer<Boolean> callback) {
public void autoLoad(boolean autoReload, Consumer<Boolean> callback) {
if (autoReload) {
Assert.notNull(this.settingUrl, "Setting URL is null !");
if (null != this.watchMonitor) {
@ -489,12 +489,13 @@ public class Setting extends AbsSetting implements Map<String, String> {
this.groupedMap.putAll(group, m);
return this;
}
/**
* 添加一个Stting到主配置中
*
* @param setting
*
* @param setting Setting配置
* @return this
* @since 5.2.4
*/
public Setting addSetting(Setting setting) {
for (Entry<String, LinkedHashMap<String, String>> e : setting.getGroupedMap().entrySet()) {