Class BooleanNode

java.lang.Object
dev.satyrn.papermc.api.configuration.v1.ConfigurationNode<Boolean>
dev.satyrn.papermc.api.configuration.v1.BooleanNode
Direct Known Subclasses:
MySQLConfiguration

public class BooleanNode extends ConfigurationNode<Boolean>
Represents a configuration node with a boolean value.
Since:
1.0.0
Author:
Isabel Maskrey
  • Constructor Details

    • BooleanNode

      public BooleanNode(@NotNull @NotNull ConfigurationNode<?> parent, @NotNull @NotNull String name)
      Creates a new configuration node with a boolean value.
      Parameters:
      parent - The parent container.
      name - The name of the configuration node.
      Since:
      1.0.0
  • Method Details

    • value

      @NotNull public final @NotNull Boolean value()
      Returns the boolean value of the node.
      Specified by:
      value in class ConfigurationNode<Boolean>
      Returns:
      The boolean value.
      Since:
      1.0.0
    • defaultValue

      @NotNull public @NotNull Boolean defaultValue()
      Gets the default value of the node.

      Defaults to false.

      Specified by:
      defaultValue in class ConfigurationNode<Boolean>
      Returns:
      The default value.
      Since:
      1.3.0
    • getValueNodeName

      @NotNull public @NotNull String getValueNodeName()
      Gets the name of the "value" node, which will be used if this node contains children and a value.

      Defaults to "enabled" for boolean nodes.

      Overrides:
      getValueNodeName in class ConfigurationNode<Boolean>
      Returns:
      The name of the value node.
      Since:
      1.9.0
    • setValue

      public void setValue(@Nullable @Nullable Boolean value)
      Sets the value of the node in the configuration file.
      Overrides:
      setValue in class ConfigurationNode<Boolean>
      Parameters:
      value - The value to set.
      Since:
      1.9.0