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, parsedTimeFields 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()voidbooleanbooleanaddAll(int index, @NotNull Collection<? extends V> c) booleanaddAll(@NotNull Collection<? extends V> c) static <T> @NotNull ConfigListBuilder<T> static <T> @NotNull ConfigListBuilder<T> voidclear()booleanbooleancontainsAll(@NotNull Collection<?> c) copy()get()Gets the configured value (i.e., the value read from the source).get(int index) <T> TintbooleanisEmpty()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) booleanbooleanremoveAll(@NotNull Collection<?> c) booleanretainAll(@NotNull Collection<?> c) @Nullable ValueSerializer<V> voidSets the value of this configuration.intsize()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, updateCacheMethods inherited from class cc.carm.lib.configuration.value.ConfigValue
getNotNull, 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
parallelStream, removeIf, stream, toArrayMethods 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: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<List<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<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:
containsAllin interfaceCollection<V>- Specified by:
containsAllin interfaceList<V>
-
add
-
add
-
addAll
-
addAll
-
remove
-
remove
-
removeAll
-
retainAll
-
clear
public void clear() -
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<V>
-
listIterator
- Specified by:
listIteratorin interfaceList<V>
-
listIterator
- Specified by:
listIteratorin interfaceList<V>
-
subList
-