Class FakeUnmodifiableCommentedConfig
- java.lang.Object
-
- com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper<UnmodifiableConfig>
-
- com.electronwill.nightconfig.core.utils.FakeUnmodifiableCommentedConfig
-
- All Implemented Interfaces:
UnmodifiableCommentedConfig,UnmodifiableConfig
public final class FakeUnmodifiableCommentedConfig extends UnmodifiableConfigWrapper<UnmodifiableConfig> implements UnmodifiableCommentedConfig
A fake UnmodifiableCommentedConfig that wraps a config that doesn't support comments.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.electronwill.nightconfig.core.UnmodifiableCommentedConfig
UnmodifiableCommentedConfig.CommentNode, UnmodifiableCommentedConfig.Entry
-
Nested classes/interfaces inherited from interface com.electronwill.nightconfig.core.UnmodifiableConfig
UnmodifiableConfig.Entry
-
-
Field Summary
-
Fields inherited from class com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper
config
-
-
Constructor Summary
Constructors Constructor Description FakeUnmodifiableCommentedConfig(UnmodifiableConfig config)Creates a FakeUnmodifiableCommentedConfig that gets all its values from the given config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>commentMap()Returns a Map view of the config's comments.booleancontainsComment(java.util.List<java.lang.String> path)Checks if the config contains a comment at some path.java.util.Set<? extends UnmodifiableCommentedConfig.Entry>entrySet()Returns a Set view of the config's entries.java.lang.StringgetComment(java.util.List<java.lang.String> path)Gets a comment from the config.java.util.Map<java.lang.String,UnmodifiableCommentedConfig.CommentNode>getComments()Returns a Map containing a deep copy of all the comments in the config.-
Methods inherited from class com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper
configFormat, contains, equals, getRaw, hashCode, isEmpty, size, valueMap
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.electronwill.nightconfig.core.UnmodifiableCommentedConfig
containsComment, getComment, getComments, getOptionalComment, getOptionalComment
-
Methods inherited from interface com.electronwill.nightconfig.core.UnmodifiableConfig
apply, 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, valueMap
-
-
-
-
Constructor Detail
-
FakeUnmodifiableCommentedConfig
public FakeUnmodifiableCommentedConfig(UnmodifiableConfig config)
Creates a FakeUnmodifiableCommentedConfig that gets all its values from the given config. The FakeUnmodifiableCommentedConfig implements UnmodifiableCommentedConfig but all operations on comments do nothing.- Parameters:
config- the config to use for the values
-
-
Method Detail
-
getComment
public java.lang.String getComment(java.util.List<java.lang.String> path)
Description copied from interface:UnmodifiableCommentedConfigGets a comment from the config.- Specified by:
getCommentin interfaceUnmodifiableCommentedConfig- Parameters:
path- the comment's path, each element of the list is a different part of the path.- Returns:
- the comment at the given path, or
nullif there is none.
-
containsComment
public boolean containsComment(java.util.List<java.lang.String> path)
Description copied from interface:UnmodifiableCommentedConfigChecks if the config contains a comment at some path.- Specified by:
containsCommentin interfaceUnmodifiableCommentedConfig- Parameters:
path- the path to check, each element of the list is a different part of the path.- Returns:
trueif the path is associated with a comment,falseif it's not.
-
getComments
public java.util.Map<java.lang.String,UnmodifiableCommentedConfig.CommentNode> getComments()
Description copied from interface:UnmodifiableCommentedConfigReturns a Map containing a deep copy of all the comments in the config.- Specified by:
getCommentsin interfaceUnmodifiableCommentedConfig- Returns:
- a Map containing the comments in the config.
-
commentMap
public java.util.Map<java.lang.String,java.lang.String> commentMap()
Description copied from interface:UnmodifiableCommentedConfigReturns a Map view of the config's comments. If the config is unmodifiable then the returned map is unmodifiable too.The comment map contains only the comments of the direct elements of the configuration, not the comments of their sub-elements.
- Specified by:
commentMapin interfaceUnmodifiableCommentedConfig- Returns:
- a Map view of the config's comments.
-
entrySet
public java.util.Set<? extends UnmodifiableCommentedConfig.Entry> entrySet()
Description copied from interface:UnmodifiableConfigReturns a Set view of the config's entries. If the config is unmodifiable then the returned set is unmodifiable too.- Specified by:
entrySetin interfaceUnmodifiableCommentedConfig- Specified by:
entrySetin interfaceUnmodifiableConfig- Overrides:
entrySetin classUnmodifiableConfigWrapper<UnmodifiableConfig>- Returns:
- a Set view of the config's entries.
-
-