Class EnumListNode<E extends Enum<E>>

java.lang.Object
dev.satyrn.papermc.api.configuration.v1.ConfigurationNode<List<E>>
dev.satyrn.papermc.api.configuration.v1.EnumListNode<E>
Type Parameters:
E - The enum type.
Direct Known Subclasses:
EnumListNode

public abstract class EnumListNode<E extends Enum<E>> extends ConfigurationNode<List<E>>
Represents a configuration node with a list of enum values.
Since:
1.0.0
Author:
Isabel Maskrey
  • Constructor Details

    • EnumListNode

      public EnumListNode(@NotNull @NotNull ConfigurationNode<?> parent, @NotNull @NotNull String name)
      Creates a new configuration node with a list of enum values.
      Parameters:
      parent - The parent configuration.
      name - The node's name.
      Since:
      1.0.0
  • Method Details

    • value

      @NotNull public @NotNull @Unmodifiable List<E> value()
      Gets the value of the node.
      Specified by:
      value in class ConfigurationNode<List<E extends Enum<E>>>
      Returns:
      The value.
      Since:
      1.0.0
    • parse

      @NotNull protected abstract E parse(@NotNull @NotNull String value) throws IllegalArgumentException
      Parses the enum value.
      Parameters:
      value - The string value from the config file
      Returns:
      The parsed enum value.
      Throws:
      IllegalArgumentException - Thrown when an invalid value is parsed.
      Since:
      1.0.0
    • defaultValue

      @NotNull public final @NotNull @Unmodifiable List<E> defaultValue()
      Gets the default value of the node.

      Defaults to an empty, unmodifiable list.

      Specified by:
      defaultValue in class ConfigurationNode<List<E extends Enum<E>>>
      Returns:
      The value.
      Since:
      1.3.0