Class IntegerNode

java.lang.Object
dev.satyrn.papermc.api.configuration.v1.ConfigurationNode<Integer>
dev.satyrn.papermc.api.configuration.v1.IntegerNode

public class IntegerNode extends ConfigurationNode<Integer>
Represents a configuration node with an integer value.
Since:
1.0.0
Author:
Isabel Maskrey
  • Constructor Details

    • IntegerNode

      public IntegerNode(@NotNull @NotNull ConfigurationNode<?> parent, @NotNull @NotNull String name)
      Creates a new configuration node with an integer value.
      Parameters:
      parent - The parent container.
      name - The node's name.
      Since:
      1.0.0
    • IntegerNode

      public IntegerNode(@NotNull @NotNull ConfigurationNode<?> parent, @NotNull @NotNull String name, int minValue, int maxValue)
      Creates a new configuration node with an integer value. The value is bounded by min and max.
      Parameters:
      parent - The parent configuration container.
      name - The node's name.
      minValue - The minimum value allowed by the node.
      maxValue - The maximum value allowed by the node.
      Since:
      1.6.2
  • Method Details

    • value

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

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

      Defaults to 0.

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

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