1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2024-09-19 20:25:51 +00:00

feat(list): 添加快速获取副本列表的方法

This commit is contained in:
Carm Jos 2023-07-17 17:34:34 +08:00
parent e4435bf883
commit 56557221a4

View File

@ -65,6 +65,10 @@ public class ConfiguredList<V> extends CachedConfigValue<List<V>> implements Lis
return get().get(index);
}
public @NotNull List<V> copy() {
return new ArrayList<>(get());
}
public <T> @NotNull T handle(Function<List<V>, T> function) {
List<V> list = get();
T result = function.apply(list);