Class RootNode


public abstract class RootNode extends ContainerNode
Represents a value-less node which contains other nodes.
Since:
1.9.0
Author:
Isabel Maskrey
  • 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 class ContainerNode
      Since:
      1.9.0
    • toString

      public void toString(@NotNull @NotNull StringBuilder stringBuilder)
      Builds the string representation of the node.

      By default, ContainerNodes return just the name of the node.

      Overrides:
      toString in class ContainerNode
      Parameters:
      stringBuilder - The StringBuilder 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

      public boolean equals(Object obj)
      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 class ConfigurationNode<Void>
      Parameters:
      obj -
      Since:
      1.10.0