Package pers.neige.neigeitems.manager
Class AbstractConfigManager
-
- All Implemented Interfaces:
-
java.io.Serializable,java.util.Map,java.util.concurrent.ConcurrentMap
public abstract class AbstractConfigManager<K, V, R> extends ConcurrentHashMap<K, V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAbstractConfigManager.FileConfigpublic classAbstractConfigManager.RawConfig
-
Constructor Summary
Constructors Constructor Description AbstractConfigManager(JavaPlugin plugin, String elementName, String directory, BiFunction<ConfigurationSection, String, R> configGetter, Function<String, K> keyConverter, BiFunction<K, R, V> converter)AbstractConfigManager(String pluginName, Logger logger, String elementName, String directory, BiFunction<ConfigurationSection, String, R> configGetter, Function<String, K> keyConverter, BiFunction<K, R, V> converter)AbstractConfigManager(String pluginName, Logger logger, String elementName, String directory, BiFunction<ConfigurationSection, String, R> configGetter, Function<String, K> keyConverter, BiFunction<K, R, V> converter)
-
Method Summary
Modifier and Type Method Description ConcurrentHashMap<String, AbstractConfigManager.FileConfig>getFileConfigs()ConcurrentHashMap<K, AbstractConfigManager.RawConfig<R>>getRawConfigs()voidsaveExamples()如果 plugin 不为 null, 尝试保存目录下的 example. voidreload()clear 后调用 load voidload()根据 loadConfigsParts 方法加载所有配置组件, 而后通过 converter 对组件进行类型转换 -
Methods inherited from class java.util.concurrent.ConcurrentHashMap
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEachEntry, forEachKey, forEachValue, get, getOrDefault, hashCode, isEmpty, keySet, keys, mappingCount, merge, newKeySet, put, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values -
Methods inherited from class java.util.AbstractMap
keySet -
Methods inherited from class java.util.Map
copyOf, entry, of, ofEntries -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AbstractConfigManager
AbstractConfigManager(JavaPlugin plugin, String elementName, String directory, BiFunction<ConfigurationSection, String, R> configGetter, Function<String, K> keyConverter, BiFunction<K, R, V> converter)
-
AbstractConfigManager
AbstractConfigManager(String pluginName, Logger logger, String elementName, String directory, BiFunction<ConfigurationSection, String, R> configGetter, Function<String, K> keyConverter, BiFunction<K, R, V> converter)
-
-
Method Detail
-
getFileConfigs
@NonNull() ConcurrentHashMap<String, AbstractConfigManager.FileConfig> getFileConfigs()
-
getRawConfigs
@NonNull() ConcurrentHashMap<K, AbstractConfigManager.RawConfig<R>> getRawConfigs()
-
saveExamples
void saveExamples()
如果 plugin 不为 null, 尝试保存目录下的 example.yml 文件
-
reload
void reload()
clear 后调用 load
-
load
void load()
根据 loadConfigsParts 方法加载所有配置组件, 而后通过 converter 对组件进行类型转换
-
-
-
-