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

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

      @Nullable public final @Nullable Void value()
      Gets the current value of the node.

      Always returns null for container nodes.

      Specified by:
      value in class ConfigurationNode<Void>
      Returns:
      null
      Since:
      1.9.0
    • defaultValue

      @Nullable public final @Nullable Void defaultValue()
      Gets the default value of the node.

      Always returns null for container nodes.

      Specified by:
      defaultValue in class ConfigurationNode<Void>
      Returns:
      The default value.
      Since:
      1.9.0
    • setConfigValue

      public void setConfigValue(@Nullable @Nullable Void value)
      Sets the value of the node.

      Always does nothing for container nodes.

      Overrides:
      setConfigValue in class ConfigurationNode<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 class ConfigurationNode<Void>
      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 ConfigurationNode<Void>
      Parameters:
      stringBuilder - The StringBuilder with which to build the string.
      Since:
      1.10.0