Class RootNode
java.lang.Object
dev.satyrn.papermc.api.configuration.v1.ConfigurationNode<Void>
dev.satyrn.papermc.api.configuration.v1.ContainerNode
dev.satyrn.papermc.api.configuration.v1.RootNode
Represents a value-less node which contains other nodes.
- Since:
- 1.9.0
- Author:
- Isabel Maskrey
-
Constructor Summary
ModifierConstructorDescriptionprotected
RootNode
(@NotNull org.bukkit.plugin.Plugin plugin) Initializes the configuration container as a root container. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.int
Gets the config version.void
save()
Writes the value of the node to the config file.void
setVersion
(int newVersion) Sets the config version.void
toString
(@NotNull StringBuilder stringBuilder) Builds the string representation of the node.abstract void
upgrade()
Upgrades the configuration to the latest version.Methods inherited from class dev.satyrn.papermc.api.configuration.v1.ContainerNode
defaultValue, setConfigValue, value
Methods inherited from class dev.satyrn.papermc.api.configuration.v1.ConfigurationNode
addChild, 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
-
RootNode
protected RootNode(@NotNull @NotNull org.bukkit.plugin.Plugin plugin) Initializes the configuration container as a root container.- Parameters:
plugin
- The plugin instance.- Since:
- 1.9.0
-
-
Method Details
-
getVersion
public int getVersion()Gets the config version.- Returns:
- The version of the configuration file.
- Since:
- 1.9.0
-
setVersion
public void setVersion(int newVersion) Sets the config version.- Parameters:
newVersion
- The new version of the config file.- Since:
- 1.9.0
-
save
public void save()Writes the value of the node to the config file.- Overrides:
save
in classContainerNode
- 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 classContainerNode
- Parameters:
stringBuilder
- TheStringBuilder
with which to build the string.- Since:
- 1.10.0
-
upgrade
public abstract void upgrade()Upgrades the configuration to the latest version.- Since:
- 1.9.0
-
equals
Indicates whether some other object is "equal to" this one.Two
ConfigurationNode
objects are equivalent based purely on whether their plugin instance and base path are the same.- Overrides:
equals
in classConfigurationNode<Void>
- Parameters:
obj
-- Since:
- 1.10.0
-