public interface CommentedConfig extends UnmodifiableCommentedConfig, Config
| Modifier and Type | Interface and Description |
|---|---|
static interface |
CommentedConfig.Entry
A modifiable commented config entry.
|
UnmodifiableCommentedConfig.CommentNode| Modifier and Type | Method and Description |
|---|---|
default CommentedConfig |
checked()
Returns a checked view of the config.
|
void |
clearComments()
Removes all the comments from the config.
|
java.util.Map<java.lang.String,java.lang.String> |
commentMap()
Deprecated.
commentMap() may not be supported by some config types, in
particular ConcurrentConfig, and may be removed in a future version.
Prefer to use entrySet() instead. |
static CommentedConfig |
concurrentCopy(UnmodifiableCommentedConfig config)
Deprecated.
A concurrent HashMap is not enough to make the whole configuration robust to multi-threaded
use. Prefer to use a
ConcurrentConfig
instead. |
static CommentedConfig |
concurrentCopy(UnmodifiableCommentedConfig config,
ConfigFormat<?> format)
Deprecated.
A concurrent HashMap is not enough to make the whole configuration robust to multi-threaded
use. Prefer to use a
ConcurrentConfig
instead. |
static CommentedConfig |
concurrentCopy(UnmodifiableConfig config)
Deprecated.
A concurrent HashMap is not enough to make the whole configuration robust to multi-threaded
use. Prefer to use a
ConcurrentConfig
instead. |
static CommentedConfig |
concurrentCopy(UnmodifiableConfig config,
ConfigFormat<?> format)
Deprecated.
A concurrent HashMap is not enough to make the whole configuration robust to multi-threaded
use. Prefer to use a
ConcurrentConfig
instead. |
static CommentedConfig |
copy(UnmodifiableCommentedConfig config)
Creates a new CommentedConfig with the content of the given config.
|
static CommentedConfig |
copy(UnmodifiableCommentedConfig config,
ConfigFormat<?> format)
Creates a new CommentedConfig with the content of the given config.
|
static CommentedConfig |
copy(UnmodifiableCommentedConfig config,
java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator)
Creates a new CommentedConfig with the content of the given config.
|
static CommentedConfig |
copy(UnmodifiableCommentedConfig config,
java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator,
ConfigFormat<? extends CommentedConfig> format)
Creates a new CommentedConfig with the content of the given config.
|
static CommentedConfig |
copy(UnmodifiableConfig config)
Creates a new CommentedConfig with the content of the given config.
|
static CommentedConfig |
copy(UnmodifiableConfig config,
ConfigFormat<?> format)
Creates a new CommentedConfig with the content of the given config.
|
static CommentedConfig |
copy(UnmodifiableConfig config,
java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator)
Creates a new CommentedConfig with the content of the given config.
|
static CommentedConfig |
copy(UnmodifiableConfig config,
java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator,
ConfigFormat<?> format)
Creates a new CommentedConfig with the content of the given config.
|
CommentedConfig |
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). |
java.util.Set<? extends CommentedConfig.Entry> |
entrySet()
Returns a Set view of the config's entries.
|
static CommentedConfig |
fake(Config config)
If the specified config is an instance of CommentedConfig, returns it.
|
static CommentedConfig |
inMemory()
Creates a CommentedConfig with format
InMemoryCommentedFormat.defaultInstance(). |
static CommentedConfig |
inMemoryConcurrent()
Deprecated.
A concurrent HashMap is not enough to make the whole configuration robust to multi-threaded
use. Prefer to use a
ConcurrentConfig
instead. |
static CommentedConfig |
of(ConfigFormat<? extends CommentedConfig> format)
Creates a CommentedConfig of the given format.
|
static CommentedConfig |
of(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator,
ConfigFormat<? extends CommentedConfig> format)
Creates a Config backed by a certain kind of map, given by a supplier.
|
static CommentedConfig |
ofConcurrent(ConfigFormat<? extends CommentedConfig> format)
Deprecated.
A concurrent HashMap is not enough to make the whole configuration robust to multi-threaded
use. Prefer to use a
ConcurrentConfig
instead. |
default void |
putAllComments(java.util.Map<java.lang.String,UnmodifiableCommentedConfig.CommentNode> comments)
Puts the comments in the given map to this config.
|
default void |
putAllComments(UnmodifiableCommentedConfig commentedConfig)
Puts the comments in the given config to this config.
|
java.lang.String |
removeComment(java.util.List<java.lang.String> path)
Removes a comment from the config.
|
default java.lang.String |
removeComment(java.lang.String path)
Removes a comment from the config.
|
java.lang.String |
setComment(java.util.List<java.lang.String> path,
java.lang.String comment)
Sets a config comment.
|
default java.lang.String |
setComment(java.lang.String path,
java.lang.String comment)
Sets a config comment.
|
default UnmodifiableCommentedConfig |
unmodifiable()
Returns an Unmodifiable view of the config.
|
static CommentedConfig |
wrap(java.util.Map<java.lang.String,java.lang.Object> map,
ConfigFormat<?> format)
Creates a CommentedConfig backed by a Map.
|
containsComment, 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, sizedefault java.lang.String setComment(java.lang.String path,
java.lang.String comment)
path - the comment's path, each part separated by a dot. Example "a.b.c"comment - the comment to setnulljava.lang.String setComment(java.util.List<java.lang.String> path,
java.lang.String comment)
path - the comment's path, each element of the list is a different part of the path.comment - the comment to setnulldefault java.lang.String removeComment(java.lang.String path)
path - the comment's path, each part separated by a dot. Example "a.b.c"nulljava.lang.String removeComment(java.util.List<java.lang.String> path)
path - the comment's path, each element of the list is a different part of the path.nullvoid clearComments()
default void putAllComments(java.util.Map<java.lang.String,UnmodifiableCommentedConfig.CommentNode> comments)
comments - the comments to setdefault void putAllComments(UnmodifiableCommentedConfig commentedConfig)
The comments are copied recursively, but missing sub-configurations are NOT created.
commentedConfig - the config to copy its commentsdefault UnmodifiableCommentedConfig unmodifiable()
Configunmodifiable in interface Configdefault CommentedConfig checked()
ConfigConfigFormat.supportsType(Class)
method. Trying to insert an unsupported value throws an IllegalArgumentException.
The values that are in the config when this method is called are also checked.
@Deprecated java.util.Map<java.lang.String,java.lang.String> commentMap()
commentMap() may not be supported by some config types, in
particular ConcurrentConfig, and may be removed in a future version.
Prefer to use entrySet() instead.The comment map contains only the comments of the direct elements of the configuration, not the comments of their sub-elements.
commentMap in interface UnmodifiableCommentedConfigjava.util.Set<? extends CommentedConfig.Entry> entrySet()
UnmodifiableConfigentrySet in interface ConfigentrySet in interface UnmodifiableCommentedConfigentrySet in interface UnmodifiableConfigCommentedConfig createSubConfig()
ConfigConfig.set(List, Object) or Config.add(List, Object).createSubConfig in interface Configstatic CommentedConfig of(ConfigFormat<? extends CommentedConfig> format)
format - the config's formatstatic CommentedConfig of(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator, ConfigFormat<? extends CommentedConfig> format)
mapCreator - a supplier which will be called to create all backing maps for this config (including
sub-configs)format - the config's format@Deprecated static CommentedConfig ofConcurrent(ConfigFormat<? extends CommentedConfig> format)
ConcurrentConfig
instead.format - the config's formatstatic CommentedConfig inMemory()
InMemoryCommentedFormat.defaultInstance().@Deprecated static CommentedConfig inMemoryConcurrent()
ConcurrentConfig
instead.InMemoryFormat.defaultInstance().inMemoryConcurrent in interface Configstatic CommentedConfig wrap(java.util.Map<java.lang.String,java.lang.Object> map, ConfigFormat<?> format)
static CommentedConfig copy(UnmodifiableConfig config)
static CommentedConfig copy(UnmodifiableConfig config, java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator)
copy in interface Configconfig - the config to copymapCreator - a supplier which will be called to create all backing maps for this config (including
sub-configs)of(Supplier, ConfigFormat)static CommentedConfig copy(UnmodifiableConfig config, ConfigFormat<?> format)
static CommentedConfig copy(UnmodifiableConfig config, java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator, ConfigFormat<?> format)
copy in interface Configconfig - the config to copymapCreator - a supplier which will be called to create all backing maps for this config (including
sub-configs)format - the config's formatof(Supplier, ConfigFormat)static CommentedConfig copy(UnmodifiableCommentedConfig config)
config - the config to copystatic CommentedConfig copy(UnmodifiableCommentedConfig config, java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator)
config - the config to copymapCreator - a supplier which will be called to create all backing maps for this config (including
sub-configs)static CommentedConfig copy(UnmodifiableCommentedConfig config, ConfigFormat<?> format)
config - the config to copyformat - the config's formatstatic CommentedConfig copy(UnmodifiableCommentedConfig config, java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator, ConfigFormat<? extends CommentedConfig> format)
config - the config to copymapCreator - a supplier which will be called to create all backing maps for this config (including
sub-configs)format - the config's formatof(Supplier, ConfigFormat)@Deprecated static CommentedConfig concurrentCopy(UnmodifiableConfig config)
ConcurrentConfig
instead.concurrentCopy in interface Configconfig - the config to copy@Deprecated static CommentedConfig concurrentCopy(UnmodifiableConfig config, ConfigFormat<?> format)
ConcurrentConfig
instead.concurrentCopy in interface Configconfig - the config to copyformat - the config's format@Deprecated static CommentedConfig concurrentCopy(UnmodifiableCommentedConfig config)
ConcurrentConfig
instead.config - the config to copy@Deprecated static CommentedConfig concurrentCopy(UnmodifiableCommentedConfig config, ConfigFormat<?> format)
ConcurrentConfig
instead.config - the config to copyformat - the config's formatstatic CommentedConfig fake(Config config)
config - the config