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
ConstructorsModifierConstructorDescriptionprotectedContainerNode(@NotNull ConfigurationNode<?> parent, @Nullable String name) Initializes the node as a child of another node.protectedContainerNode(@NotNull org.bukkit.plugin.Plugin plugin) Initializes the node without a parent. -
Method Summary
Modifier and TypeMethodDescriptionfinal @Nullable VoidGets the default value of the node.voidsave()Writes the value of the node to the config file.voidsetConfigValue(@Nullable Void value) Sets the value of the node.voidtoString(@NotNull StringBuilder stringBuilder) Builds the string representation of the node.final @Nullable Voidvalue()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:
valuein classConfigurationNode<Void>- Returns:
null- Since:
- 1.9.0
-
defaultValue
Gets the default value of the node.Always returns null for container nodes.
- Specified by:
defaultValuein classConfigurationNode<Void>- Returns:
- The default value.
- Since:
- 1.9.0
-
setConfigValue
Sets the value of the node.Always does nothing for container nodes.
- Overrides:
setConfigValuein 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:
savein classConfigurationNode<Void>- Since:
- 1.9.0
-
toString
Builds the string representation of the node.By default,
ContainerNodes return just the name of the node.- Overrides:
toStringin classConfigurationNode<Void>- Parameters:
stringBuilder- TheStringBuilderwith which to build the string.- Since:
- 1.10.0
-