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
ConstructorsModifierConstructorDescriptionprotectedRootNode(@NotNull org.bukkit.plugin.Plugin plugin) Initializes the configuration container as a root container. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.intGets the config version.voidsave()Writes the value of the node to the config file.voidsetVersion(int newVersion) Sets the config version.voidtoString(@NotNull StringBuilder stringBuilder) Builds the string representation of the node.abstract voidupgrade()Upgrades the configuration to the latest version.Methods inherited from class dev.satyrn.papermc.api.configuration.v1.ContainerNode
defaultValue, setConfigValue, valueMethods 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:
savein classContainerNode- Since:
- 1.9.0
-
toString
Builds the string representation of the node.By default,
ContainerNodes return just the name of the node.- Overrides:
toStringin classContainerNode- Parameters:
stringBuilder- TheStringBuilderwith 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
ConfigurationNodeobjects are equivalent based purely on whether their plugin instance and base path are the same.- Overrides:
equalsin classConfigurationNode<Void>- Parameters:
obj-- Since:
- 1.10.0
-