Class ConfiguredList<V>
java.lang.Object
cc.carm.lib.configuration.value.ValueManifest<List<V>,V>
cc.carm.lib.configuration.value.ConfigValue<List<V>,V>
cc.carm.lib.configuration.value.impl.CachedConfigValue<List<V>,V>
cc.carm.lib.configuration.value.standard.ConfiguredList<V>
- All Implemented Interfaces:
Iterable<V>
,Collection<V>
,List<V>
,SequencedCollection<V>
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionConfiguredList
(@NotNull ValueManifest<List<V>, V> manifest, @NotNull Supplier<? extends List<V>> constructor, @NotNull ValueAdapter<V> paramAdapter) -
Method Summary
Modifier and TypeMethodDescription@NotNull ValueAdapter
<V> adapter()
void
boolean
boolean
addAll
(int index, @NotNull Collection<? extends V> c) boolean
addAll
(@NotNull Collection<? extends V> c) static <T> @NotNull ConfigListBuilder
<T> static <T> @NotNull ConfigListBuilder
<T> void
clear()
boolean
boolean
containsAll
(@NotNull Collection<?> c) copy()
get()
Gets the configured value (i.e., the value read from the source).get
(int index) <T> T
int
boolean
isEmpty()
iterator()
int
@NotNull ListIterator
<V> @NotNull ListIterator
<V> listIterator
(int index) @NotNull ConfiguredList
<V> static <T> @NotNull ConfiguredList
<T> of
(T value, T... values) @Nullable ValueParser
<V> parser()
remove
(int index) boolean
boolean
removeAll
(@NotNull Collection<?> c) boolean
retainAll
(@NotNull Collection<?> c) @Nullable ValueSerializer
<V> void
Sets the value of this configuration.int
size()
subList
(int fromIndex, int toIndex) @NotNull Object @NotNull []
toArray()
<T> T @NotNull []
toArray
(T[] a) static <T> @NotNull SourceListBuilder
<T, T> static <T> @NotNull SourceListBuilder
<T, T> 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.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Field Details
-
constructor
-
paramAdapter
-
-
Constructor Details
-
ConfiguredList
public ConfiguredList(@NotNull @NotNull ValueManifest<List<V>, V> manifest, @NotNull @NotNull Supplier<? extends List<V>> constructor, @NotNull @NotNull ValueAdapter<V> paramAdapter)
-
-
Method Details
-
builderOf
-
builderOf
@NotNull public static <T> @NotNull ConfigListBuilder<T> builderOf(@NotNull @NotNull ValueType<T> type) -
with
@NotNull public static <T> @NotNull SourceListBuilder<T,T> with(@NotNull @NotNull Class<T> registeredType) -
with
@NotNull public static <T> @NotNull SourceListBuilder<T,T> with(@NotNull @NotNull ValueType<T> registeredType) -
of
@SafeVarargs @NotNull public static <T> @NotNull ConfiguredList<T> of(@NotNull T value, @NotNull T... values) -
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: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.- Specified by:
get
in classConfigValue<List<V>,
V> - Returns:
- Configured value
-
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()
.- Specified by:
set
in classConfigValue<List<V>,
V> - Parameters:
list
- The value to set
-
get
-
copy
-
handle
-
modify
-
set
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
@NotNull public <T> T @NotNull [] toArray(@NotNull T[] a) -
containsAll
- Specified by:
containsAll
in interfaceCollection<V>
- Specified by:
containsAll
in interfaceList<V>
-
add
-
add
-
addAll
-
addAll
-
remove
-
remove
-
removeAll
-
retainAll
-
clear
public void clear() -
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<V>
-
listIterator
- Specified by:
listIterator
in interfaceList<V>
-
listIterator
- Specified by:
listIterator
in interfaceList<V>
-
subList
-