Class ConfigWrapper<C extends Config>
- java.lang.Object
-
- com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper<C>
-
- com.electronwill.nightconfig.core.utils.ConfigWrapper<C>
-
- All Implemented Interfaces:
Config,UnmodifiableConfig
- Direct Known Subclasses:
CommentedConfigWrapper,ConvertedCommentedConfig,ConvertedCommentedFileConfig,ConvertedConfig,ConvertedFileConfig,FakeCommentedConfig
public abstract class ConfigWrapper<C extends Config> extends UnmodifiableConfigWrapper<C> implements Config
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.electronwill.nightconfig.core.Config
Config.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 Modifier Constructor Description protectedConfigWrapper(C config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(java.util.List<java.lang.String> path, java.lang.Object value)Adds a config value.voidclear()Removes all values from the config.ConfigcreateSubConfig()Creates a new sub config of this config, as created when a subconfig's creation is implied byConfig.set(List, Object)orConfig.add(List, Object).java.util.Set<? extends Config.Entry>entrySet()Returns a Set view of the config's entries.<T> Tremove(java.util.List<java.lang.String> path)Removes a value from the config.<T> Tset(java.util.List<java.lang.String> path, java.lang.Object value)Sets a config value.java.lang.StringtoString()-
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, wait, wait, wait
-
Methods inherited from interface com.electronwill.nightconfig.core.Config
add, addAll, checked, putAll, remove, removeAll, set, unmodifiable, update, update, valueMap
-
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
-
-
-
-
Constructor Detail
-
ConfigWrapper
protected ConfigWrapper(C config)
-
-
Method Detail
-
entrySet
public java.util.Set<? extends Config.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 interfaceConfig- Specified by:
entrySetin interfaceUnmodifiableConfig- Overrides:
entrySetin classUnmodifiableConfigWrapper<C extends Config>- Returns:
- a Set view of the config's entries.
-
set
public <T> T set(java.util.List<java.lang.String> path, java.lang.Object value)Description copied from interface:ConfigSets a config value.
-
add
public boolean add(java.util.List<java.lang.String> path, java.lang.Object value)Description copied from interface:ConfigAdds a config value. The value is set iff there is no value associated with the given path.
-
remove
public <T> T remove(java.util.List<java.lang.String> path)
Description copied from interface:ConfigRemoves a value from the config.
-
clear
public void clear()
Description copied from interface:ConfigRemoves all values from the config.
-
createSubConfig
public Config createSubConfig()
Description copied from interface:ConfigCreates a new sub config of this config, as created when a subconfig's creation is implied byConfig.set(List, Object)orConfig.add(List, Object).- Specified by:
createSubConfigin interfaceConfig- Returns:
- a new sub config
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-