Class UnmodifiableConfigWrapper<C extends UnmodifiableConfig>
- java.lang.Object
-
- com.electronwill.nightconfig.core.utils.UnmodifiableConfigWrapper<C>
-
- All Implemented Interfaces:
UnmodifiableConfig
- Direct Known Subclasses:
ConfigWrapper,FakeUnmodifiableCommentedConfig
public abstract class UnmodifiableConfigWrapper<C extends UnmodifiableConfig> extends java.lang.Object implements UnmodifiableConfig
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.electronwill.nightconfig.core.UnmodifiableConfig
UnmodifiableConfig.Entry
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUnmodifiableConfigWrapper(C config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigFormat<?>configFormat()Returns the config's format.booleancontains(java.util.List<java.lang.String> path)Checks if the config contains a value at some path.java.util.Set<? extends UnmodifiableConfig.Entry>entrySet()Returns a Set view of the config's entries.booleanequals(java.lang.Object obj)<T> TgetRaw(java.util.List<java.lang.String> path)Gets a value from the config.inthashCode()booleanisEmpty()Checks if the config is empty.intsize()Gets the size of the config.java.util.Map<java.lang.String,java.lang.Object>valueMap()Returns a Map view of the config's values.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.electronwill.nightconfig.core.UnmodifiableConfig
apply, apply, 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, getShort, getShort, getShortOrElse, getShortOrElse, isNull, isNull
-
-
-
-
Field Detail
-
config
protected final C extends UnmodifiableConfig config
-
-
Constructor Detail
-
UnmodifiableConfigWrapper
protected UnmodifiableConfigWrapper(C config)
-
-
Method Detail
-
getRaw
public <T> T getRaw(java.util.List<java.lang.String> path)
Description copied from interface:UnmodifiableConfigGets a value from the config. Doesn't convertNullObject.NULL_OBJECTtonull.- Specified by:
getRawin interfaceUnmodifiableConfig- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.- Returns:
- the value at the given path, or
nullif there is no such value.
-
valueMap
public java.util.Map<java.lang.String,java.lang.Object> valueMap()
Description copied from interface:UnmodifiableConfigReturns a Map view of the config's values. If the config is unmodifiable then the returned map is unmodifiable too.- Specified by:
valueMapin interfaceUnmodifiableConfig- Returns:
- a Map view of the config's values.
-
entrySet
public java.util.Set<? extends UnmodifiableConfig.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 interfaceUnmodifiableConfig- Returns:
- a Set view of the config's entries.
-
contains
public boolean contains(java.util.List<java.lang.String> path)
Description copied from interface:UnmodifiableConfigChecks if the config contains a value at some path.- Specified by:
containsin interfaceUnmodifiableConfig- 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 value,falseif it's not.
-
size
public int size()
Description copied from interface:UnmodifiableConfigGets the size of the config.- Specified by:
sizein interfaceUnmodifiableConfig- Returns:
- the number of top-level elements in the config.
-
isEmpty
public boolean isEmpty()
Description copied from interface:UnmodifiableConfigChecks if the config is empty.- Specified by:
isEmptyin interfaceUnmodifiableConfig- Returns:
trueif the config is empty,falseif it contains at least one element.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
configFormat
public ConfigFormat<?> configFormat()
Description copied from interface:UnmodifiableConfigReturns the config's format.- Specified by:
configFormatin interfaceUnmodifiableConfig- Returns:
- the config's format
-
-