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.EntryNested 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
ConstructorsConstructorDescriptionCreates a FakeUnmodifiableCommentedConfig that gets all its values from the given config. -
Method Summary
Modifier and TypeMethodDescriptionReturns a Map view of the config's comments.booleancontainsComment(List<String> path) Checks if the config contains a comment at some path.Set<? extends UnmodifiableCommentedConfig.Entry>entrySet()Returns a Set view of the config's entries.getComment(List<String> path) Gets a comment from the config.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, valueMapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.electronwill.nightconfig.core.UnmodifiableCommentedConfig
containsComment, getComment, getComments, getOptionalComment, getOptionalCommentMethods 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 Details
-
FakeUnmodifiableCommentedConfig
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 Details
-
getComment
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
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
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
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
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.
-