public interface ConcurrentCommentedConfig extends CommentedConfig, ConcurrentConfig
com.electronwill.nightconfig.core.concurrent.CommentedConfig.EntryUnmodifiableCommentedConfig.CommentNode| Modifier and Type | Method and Description |
|---|---|
default void |
bulkCommentedRead(java.util.function.Consumer<? super UnmodifiableCommentedConfig> action)
Performs multiple reads as a single atomic operation.
|
<R> R |
bulkCommentedRead(java.util.function.Function<? super UnmodifiableCommentedConfig,R> action)
Performs multiple reads as a single atomic operation, and returns a value.
|
default void |
bulkCommentedUpdate(java.util.function.Consumer<? super CommentedConfig> action)
Performs multiple reads and writes as a single atomic operation.
|
<R> R |
bulkCommentedUpdate(java.util.function.Function<? super CommentedConfig,R> action)
Performs multiple reads and writes as a single atomic operation and returns a value.
|
default <R> R |
bulkRead(java.util.function.Function<? super UnmodifiableConfig,R> action)
Performs multiple reads as a single atomic operation and returns a value.
|
default <R> R |
bulkUpdate(java.util.function.Function<? super Config,R> action)
Performs multiple reads and writes as a single atomic operation and returns a value.
|
ConcurrentCommentedConfig |
createSubConfig()
Creates a new sub config of this config, as created when a subconfig's creation is
implied by
Config.set(List, Object) or Config.add(List, Object). |
checked, clearComments, commentMap, concurrentCopy, concurrentCopy, concurrentCopy, concurrentCopy, copy, copy, copy, copy, copy, copy, copy, copy, entrySet, fake, inMemory, inMemoryConcurrent, of, of, ofConcurrent, putAllComments, putAllComments, removeComment, removeComment, setComment, setComment, unmodifiable, wrapcontainsComment, containsComment, fake, getComment, getComment, getComments, getComments, getOptionalComment, getOptionalCommentbulkRead, bulkUpdateadd, add, addAll, clear, getDefaultMapCreator, getDefaultMapCreator, inMemoryUniversal, inMemoryUniversalConcurrent, isInsertionOrderPreserved, of, of, ofConcurrent, putAll, remove, remove, removeAll, set, set, setInsertionOrderPreserved, update, update, valueMapapply, apply, configFormat, contains, contains, get, get, getByte, getByte, getByteOrElse, getByteOrElse, getChar, getChar, getCharOrElse, getCharOrElse, getEnum, getEnum, getEnum, getEnum, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getInt, getInt, getIntOrElse, getIntOrElse, getIntOrElse, getIntOrElse, getLong, getLong, getLongOrElse, getLongOrElse, getLongOrElse, getLongOrElse, getOptional, getOptional, getOptionalEnum, getOptionalEnum, getOptionalEnum, getOptionalEnum, getOptionalInt, getOptionalInt, getOptionalLong, getOptionalLong, getOrElse, getOrElse, getOrElse, getOrElse, getRaw, getRaw, getShort, getShort, getShortOrElse, getShortOrElse, isEmpty, isNull, isNull, size<R> R bulkCommentedRead(java.util.function.Function<? super UnmodifiableCommentedConfig,R> action)
It is guaranteed that the content of the config, accessed through the provided "view", will not change during the entire operation. The configuration must be used exclusively through the object passed to the consumer (the "view"), not with the original reference. After the bulk operation, the view cannot be used anymore.
Here is an example:
config.bulkCommentedRead(conf -> {
Object value = conf.get("a.b.c");
String comment = conf.getComment("a.b.c");
// note that we use `conf` and not `config`!
});
If you don't need access to the comments, prefer to use bulkRead(Function),
sine it may provide a better performance.
R - the type of the function's resultaction - a function to execute on the configuration viewdefault void bulkCommentedRead(java.util.function.Consumer<? super UnmodifiableCommentedConfig> action)
It is guaranteed that the content of the config, accessed through the provided "view", will not change during the entire operation. The configuration must be used exclusively through the object passed to the consumer (the "view"), not with the original reference. After the bulk operation, the view cannot be used anymore.
Here is an example:
Object value = config.bulkCommentedRead(conf -> {
Object value = conf.get("a.b.c");
String comment = conf.getComment("a.b.c");
// note that we use `conf` and not `config`!
return value;
});
If you don't need access to the comments, prefer to use ConcurrentConfig.bulkRead(Consumer),
sine it may provide a better performance.
action - a function to execute on the configuration view<R> R bulkCommentedUpdate(java.util.function.Function<? super CommentedConfig,R> action)
It is guaranteed that the content of the config, accessed through the provided "view", will not be concurrently modified by other threads during the entire bulk operation. The configuration must be used exclusively through the object passed to the consumer (the "view"), not with the original reference. After the bulk operation, the view cannot be used anymore.
Here is an example:
Object value = config.bulkCommentedUpdate(conf -> {
Object value = conf.get("a.b.c");
String comment = conf.getComment("a.b.c");
conf.setComment("a.b.c", comment + "\nAdditional comment here.");
// note that we use `conf` and not `config`!
return value;
});
If you don't need access to the comments, prefer to use bulkUpdate(Function),
since it may provide a better performance. Also, if you only have to read the configuration,
prefer to use bulkCommentedRead(Function).
R - the type of the function's resultaction - a function to execute on the configuration viewdefault void bulkCommentedUpdate(java.util.function.Consumer<? super CommentedConfig> action)
It is guaranteed that the content of the config, accessed through the provided "view", will not be concurrently modified by other threads during the entire bulk operation. The configuration must be used exclusively through the object passed to the consumer (the "view"), not with the original reference. After the bulk operation, the view cannot be used anymore.
Here is an example:
config.bulkCommentedUpdate(conf -> {
Object value = conf.get("a.b.c");
String comment = conf.getComment("a.b.c");
conf.setComment("a.b.c", comment + "\nAdditional comment here.");
// note that we use `conf` and not `config`!
});
If you don't need access to the comments, prefer to use ConcurrentConfig.bulkUpdate(Consumer),
since it may provide a better performance. Also, if you only have to read the configuration,
prefer to use bulkCommentedRead(Consumer).
action - a function to execute on the configuration viewdefault <R> R bulkRead(java.util.function.Function<? super UnmodifiableConfig,R> action)
ConcurrentConfigIt is guaranteed that the content of the config, accessed through the provided "view", will not change during the entire operation. The configuration must be used exclusively through the object passed to the consumer (the "view"), not with the original reference. After the bulk operation, the view cannot be used anymore.
Here is an example:
String combined = config.bulkUpdate(conf -> {
String a = conf.get("a");
String b = conf.get("b");
return a + b;
// note that we use `conf` and not `config`!
});
bulkRead in interface ConcurrentConfigR - the type of the function's resultaction - a function to execute on the configuration viewdefault <R> R bulkUpdate(java.util.function.Function<? super Config,R> action)
ConcurrentConfigIt is guaranteed that the content of the config, accessed through the provided "view", will not be concurrently modified by other threads during the entire bulk operation. The configuration must be used exclusively through the object passed to the consumer (the "view"), not with the original reference. After the bulk operation, the view cannot be used anymore.
Here is an example:
String combined = config.bulkUpdate(conf -> {
String a = conf.get("a");
String b = conf.get("b");
String combined = a + b;
conf.set("combined", combined);
return combined;
// note that we use `conf` and not `config`!
});
If you only have to read the configuration, prefer to use ConcurrentConfig.bulkRead(Function),
since it may provide a better performance.
bulkUpdate in interface ConcurrentConfigR - the type of the function's resultaction - a function to execute on the configuration viewConcurrentCommentedConfig createSubConfig()
ConfigConfig.set(List, Object) or Config.add(List, Object).createSubConfig in interface CommentedConfigcreateSubConfig in interface ConcurrentConfigcreateSubConfig in interface Config