Class ContainerNode
java.lang.Object
dev.satyrn.papermc.api.configuration.v1.ConfigurationNode<Void>
dev.satyrn.papermc.api.configuration.v1.ContainerNode
- Direct Known Subclasses:
DifficultyDependentNode
,RootNode
Represents a value-less node which contains other nodes.
- Since:
- 1.9.0
- Author:
- Isabel Maskrey
-
Constructor Summary
ModifierConstructorDescriptionprotected
ContainerNode
(@NotNull ConfigurationNode<?> parent, @Nullable String name) Initializes the node as a child of another node.protected
ContainerNode
(@NotNull org.bukkit.plugin.Plugin plugin) Initializes the node without a parent. -
Method Summary
Modifier and TypeMethodDescriptionfinal @Nullable Void
Gets the default value of the node.void
save()
Writes the value of the node to the config file.void
setConfigValue
(@Nullable Void value) Sets the value of the node.void
toString
(@NotNull StringBuilder stringBuilder) Builds the string representation of the node.final @Nullable Void
value()
Gets the current value of the node.Methods inherited from class dev.satyrn.papermc.api.configuration.v1.ConfigurationNode
addChild, equals, getBasePath, getBasePath, getChildren, getComments, getComments, getConfig, getInlineComments, getInlineComments, getLogger, getName, getPath, getPath, getPlugin, getPriority, getSLF4JLogger, getValueNodeName, getValuePath, getValuePath, hasChildren, hasName, isSubNode, setComments, setComments, setInlineComments, setInlineComments, setValue, toString
-
Constructor Details
-
ContainerNode
protected ContainerNode(@NotNull @NotNull ConfigurationNode<?> parent, @Nullable @Nullable String name) Initializes the node as a child of another node.- Parameters:
parent
- The node parent.name
- The name of the container.- Since:
- 1.9.0
-
ContainerNode
protected ContainerNode(@NotNull @NotNull org.bukkit.plugin.Plugin plugin) Initializes the node without a parent.- Parameters:
plugin
- The plugin instance.- Since:
- 1.9.0
-
-
Method Details
-
value
Gets the current value of the node.Always returns null for container nodes.
- Specified by:
value
in classConfigurationNode<Void>
- Returns:
null
- Since:
- 1.9.0
-
defaultValue
Gets the default value of the node.Always returns null for container nodes.
- Specified by:
defaultValue
in classConfigurationNode<Void>
- Returns:
- The default value.
- Since:
- 1.9.0
-
setConfigValue
Sets the value of the node.Always does nothing for container nodes.
- Overrides:
setConfigValue
in classConfigurationNode<Void>
- Parameters:
value
- The value to set.- Since:
- 1.10.0
-
save
public void save()Writes the value of the node to the config file.- Overrides:
save
in classConfigurationNode<Void>
- Since:
- 1.9.0
-
toString
Builds the string representation of the node.By default,
ContainerNode
s return just the name of the node.- Overrides:
toString
in classConfigurationNode<Void>
- Parameters:
stringBuilder
- TheStringBuilder
with which to build the string.- Since:
- 1.10.0
-