Class ConfiguredMap<K,V>
java.lang.Object
cc.carm.lib.configuration.value.ValueManifest<Map<K,V>,V>
cc.carm.lib.configuration.value.ConfigValue<Map<K,V>,V>
cc.carm.lib.configuration.value.impl.CachedConfigValue<Map<K,V>,V>
cc.carm.lib.configuration.value.standard.ConfiguredMap<K,V>
- All Implemented Interfaces:
Map<K,V>
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull ValueAdapter<K> protected final @NotNull ValueAdapter<V> Fields inherited from class cc.carm.lib.configuration.value.impl.CachedConfigValue
cachedValue, parsedTimeFields inherited from class cc.carm.lib.configuration.value.ValueManifest
defaultSupplier, holder, initializer, path, type, validator -
Constructor Summary
ConstructorsConstructorDescriptionConfiguredMap(@NotNull ValueManifest<Map<K, V>, V> manifest, @NotNull Supplier<? extends Map<K, V>> constructor, @NotNull ValueAdapter<K> keyAdapter, @NotNull ValueAdapter<V> valueAdapter) -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> ConfigMapCreator <K, V> static <K,V> ConfigMapCreator <K, V> static <V> ConfigMapCreator<String, V> voidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()get()Gets the configured value (i.e., the value read from the source).getNotNull(K key) <T> TbooleanisEmpty()@NotNull ValueAdapter<K> keySet()keyType()@NotNull ConfiguredMap<K, V> static <K,V> ConfiguredMap <K, V> of(@NotNull Supplier<? extends Map<K, V>> constructor, @NotNull ValueAdapter<K> keyAdapter, @NotNull ValueAdapter<V> valueAdapter) voidvoidSets the value of this configuration.intsize()@NotNull ValueAdapter<V> @NotNull Collection<V> values()static <K,V> @NotNull SourceMapBuilder <LinkedHashMap<K, V>, Object, K, V> static <K,V> @NotNull SourceMapBuilder <LinkedHashMap<K, V>, Object, K, V> Methods inherited from class cc.carm.lib.configuration.value.impl.CachedConfigValue
cacheExpired, getCachedOrDefault, getCachedOrDefault, getCachedValue, getDefaultFirst, parserFor, serializerFor, updateCacheMethods inherited from class cc.carm.lib.configuration.value.ConfigValue
getNotNull, getOr, getOrDefault, isDefault, optional, resolve, save, setDefault, setDefaultMethods inherited from class cc.carm.lib.configuration.value.ValueManifest
config, defaults, defaults, defaults, getData, hasDefaults, holder, holder, initialize, initialize, metadata, path, path, setData, throwing, throwing, type, validate, validator, validator, withValidatedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
constructor
-
keyAdapter
-
valueAdapter
-
-
Constructor Details
-
ConfiguredMap
public ConfiguredMap(@NotNull @NotNull ValueManifest<Map<K, V>, V> manifest, @NotNull @NotNull Supplier<? extends Map<K, V>> constructor, @NotNull @NotNull ValueAdapter<K> keyAdapter, @NotNull @NotNull ValueAdapter<V> valueAdapter)
-
-
Method Details
-
builderOf
-
builderOf
public static <K,V> ConfigMapCreator<K,V> builderOf(@NotNull @NotNull ValueType<K> keyType, @NotNull @NotNull ValueType<V> valueType) -
builderOf
public static <K,V> ConfigMapCreator<K,V> builderOf(@NotNull @NotNull Class<K> keyType, @NotNull @NotNull Class<V> valueType) -
with
@NotNull public static <K,V> @NotNull SourceMapBuilder<LinkedHashMap<K,V>, withObject, K, V> (@NotNull @NotNull Class<K> keyType, @NotNull @NotNull Class<V> valueType) -
with
@NotNull public static <K,V> @NotNull SourceMapBuilder<LinkedHashMap<K,V>, withObject, K, V> (@NotNull @NotNull ValueType<K> keyType, @NotNull @NotNull ValueType<V> valueType) -
of
public static <K,V> ConfiguredMap<K,V> of(@NotNull @NotNull Supplier<? extends Map<K, V>> constructor, @NotNull @NotNull ValueAdapter<K> keyAdapter, @NotNull @NotNull ValueAdapter<V> valueAdapter) -
keyAdapter
-
keyType
-
valueAdapter
-
valueType
-
get
Description copied from class:ConfigValueGets the configured value (i.e., the value read from the source).
If no default value was written during initialization, you can use theConfigValue.getOrDefault()method to obtain the default value when this value is empty. -
get
-
getNotNull
-
set
Description copied from class:ConfigValueSets the value of this configuration.
After setting, the configuration file will NOT be saved automatically. To save, callConfigurationHolder.save(). -
handle
-
modify
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-