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, parsedTime
Fields 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> void
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
get()
Gets the configured value (i.e., the value read from the source).getNotNull
(K key) <T> T
boolean
isEmpty()
@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) void
void
Sets the value of this configuration.int
size()
@NotNull ValueAdapter
<V> @NotNull Collection
<V> values()
Methods inherited from class cc.carm.lib.configuration.value.impl.CachedConfigValue
cacheExpired, getCachedOrDefault, getCachedOrDefault, getCachedValue, getDefaultFirst, parserFor, serializerFor, updateCache
Methods inherited from class cc.carm.lib.configuration.value.ConfigValue
getNotNull, getOrDefault, isDefault, optional, resolve, save, setDefault, setDefault
Methods 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, withValidated
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
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) -
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:ConfigValue
Gets 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:ConfigValue
Sets 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:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-