Class CollectionConfigValue<V,C extends Collection<V>,SELF extends CollectionConfigValue<V,C,SELF>>
java.lang.Object
cc.carm.lib.configuration.value.ValueManifest<C,V>
cc.carm.lib.configuration.value.ConfigValue<C,V>
cc.carm.lib.configuration.value.impl.CachedConfigValue<C,V>
cc.carm.lib.configuration.value.impl.CollectionConfigValue<V,C,SELF>
- Type Parameters:
V- Value typeC- Collection typeSELF- Self reference type (used for internal call or recursive generics)
- All Implemented Interfaces:
Iterable<V>,Collection<V>
- Direct Known Subclasses:
ConfiguredList
public abstract class CollectionConfigValue<V,C extends Collection<V>,SELF extends CollectionConfigValue<V,C,SELF>>
extends CachedConfigValue<C,V>
implements Collection<V>
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionCollectionConfigValue(@NotNull ValueManifest<C, V> manifest, @NotNull Supplier<? extends C> constructor, @NotNull ValueAdapter<V> paramAdapter) -
Method Summary
Modifier and TypeMethodDescription@NotNull ValueAdapter<V> adapter()booleanbooleanaddAll(@NotNull Collection<? extends V> c) voidclear()booleanbooleancontainsAll(@NotNull Collection<?> c) copy()get()Gets the configured value (i.e., the value read from the source).<T> TbooleanisEmpty()iterator()@Nullable ValueParser<V> parser()booleanbooleanremoveAll(@NotNull Collection<?> c) booleanretainAll(@NotNull Collection<?> c) abstract SELFself()@Nullable ValueSerializer<V> voidSets the value of this configuration.intsize()@NotNull Object @NotNull []toArray()<T> T @NotNull []toArray(T[] a) 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.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
constructor
-
paramAdapter
-
-
Constructor Details
-
CollectionConfigValue
public CollectionConfigValue(@NotNull @NotNull ValueManifest<C, V> manifest, @NotNull @NotNull Supplier<? extends C> constructor, @NotNull @NotNull ValueAdapter<V> paramAdapter)
-
-
Method Details
-
adapter
- Returns:
- Adapter of this value.
-
paramType
-
parser
- Returns:
- Value's parser, parse base object to value.
-
serializer
- Returns:
- Value's serializer, parse value to base object.
-
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.- Specified by:
getin classConfigValue<C extends Collection<V>,V> - Returns:
- Configured value
-
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().- Specified by:
setin classConfigValue<C extends Collection<V>,V> - Parameters:
collection- The value to set
-
copy
-
self
-
handle
-
modify
-
size
public int size()- Specified by:
sizein interfaceCollection<V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<V>
-
contains
- Specified by:
containsin interfaceCollection<V>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<V>
-
toArray
@NotNull public <T> T @NotNull [] toArray(@NotNull T[] a) - Specified by:
toArrayin interfaceCollection<V>
-
containsAll
- Specified by:
containsAllin interfaceCollection<V>
-
add
- Specified by:
addin interfaceCollection<V>
-
addAll
- Specified by:
addAllin interfaceCollection<V>
-
remove
- Specified by:
removein interfaceCollection<V>
-
removeAll
- Specified by:
removeAllin interfaceCollection<V>
-
retainAll
- Specified by:
retainAllin interfaceCollection<V>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<V>
-