public abstract class ConcurrentCommentedConfigWrapper<C extends ConcurrentCommentedConfig> extends CommentedConfigWrapper<C> implements ConcurrentCommentedConfig
CommentedConfig.EntryUnmodifiableCommentedConfig.CommentNodeconfig| Modifier | Constructor and Description |
|---|---|
protected |
ConcurrentCommentedConfigWrapper(C config) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
void |
bulkRead(java.util.function.Consumer<? super UnmodifiableConfig> action)
Performs multiple reads as a single atomic operation.
|
<R> R |
bulkRead(java.util.function.Function<? super UnmodifiableConfig,R> action)
Performs multiple reads as a single atomic operation and returns a value.
|
void |
bulkUpdate(java.util.function.Consumer<? super Config> action)
Performs multiple reads and writes as a single atomic operation.
|
<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). |
clearComments, commentMap, containsComment, entrySet, getComment, getComments, putAllComments, putAllComments, removeComment, setComment, toStringadd, clear, remove, setconfigFormat, contains, equals, getRaw, hashCode, isEmpty, size, valueMapclone, finalize, getClass, notify, notifyAll, wait, wait, waitchecked, 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, getOptionalCommentadd, 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, sizeprotected ConcurrentCommentedConfigWrapper(C config)
public ConcurrentCommentedConfig createSubConfig()
ConfigConfig.set(List, Object) or Config.add(List, Object).createSubConfig in interface CommentedConfigcreateSubConfig in interface ConcurrentCommentedConfigcreateSubConfig in interface ConcurrentConfigcreateSubConfig in interface ConfigcreateSubConfig in class CommentedConfigWrapper<C extends ConcurrentCommentedConfig>public void bulkRead(java.util.function.Consumer<? super UnmodifiableConfig> 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:
config.bulkRead(conf -> {
String a = conf.get("a");
String b = conf.get("b");
// note that we use `conf` and not `config`!
});
bulkRead in interface ConcurrentConfigaction - a function to execute on the configuration viewpublic <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 ConcurrentCommentedConfigbulkRead in interface ConcurrentConfigR - the type of the function's resultaction - a function to execute on the configuration viewpublic void bulkCommentedRead(java.util.function.Consumer<? super UnmodifiableCommentedConfig> action)
ConcurrentCommentedConfigIt 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.
bulkCommentedRead in interface ConcurrentCommentedConfigaction - a function to execute on the configuration viewpublic <R> R bulkCommentedRead(java.util.function.Function<? super UnmodifiableCommentedConfig,R> action)
ConcurrentCommentedConfigIt 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 ConcurrentCommentedConfig.bulkRead(Function),
sine it may provide a better performance.
bulkCommentedRead in interface ConcurrentCommentedConfigR - the type of the function's resultaction - a function to execute on the configuration viewpublic void bulkUpdate(java.util.function.Consumer<? super Config> 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:
config.bulkUpdate(conf -> {
String a = conf.get("a");
String b = conf.get("b");
String combined = a + b;
conf.set("combined", combined);
// note that we use `conf` and not `config`!
});
If you only have to read the configuration, prefer to use ConcurrentConfig.bulkRead(Consumer),
since it may provide a better performance.
bulkUpdate in interface ConcurrentConfigaction - a function to execute on the configuration viewpublic <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 ConcurrentCommentedConfigbulkUpdate in interface ConcurrentConfigR - the type of the function's resultaction - a function to execute on the configuration viewpublic void bulkCommentedUpdate(java.util.function.Consumer<? super CommentedConfig> action)
ConcurrentCommentedConfigIt 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 ConcurrentCommentedConfig.bulkCommentedRead(Consumer).
bulkCommentedUpdate in interface ConcurrentCommentedConfigaction - a function to execute on the configuration viewpublic <R> R bulkCommentedUpdate(java.util.function.Function<? super CommentedConfig,R> action)
ConcurrentCommentedConfigIt 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 ConcurrentCommentedConfig.bulkUpdate(Function),
since it may provide a better performance. Also, if you only have to read the configuration,
prefer to use ConcurrentCommentedConfig.bulkCommentedRead(Function).
bulkCommentedUpdate in interface ConcurrentCommentedConfigR - the type of the function's resultaction - a function to execute on the configuration view