Class EnumNode<E extends Enum<E>>
java.lang.Object
dev.satyrn.papermc.api.configuration.v1.ConfigurationNode<E>
dev.satyrn.papermc.api.configuration.v1.EnumNode<E>
- Direct Known Subclasses:
StorageTypeNode
Represents a configuration node with an enum value.
- Since:
- 1.0.0
- Author:
- Isabel Maskrey
-
Constructor Summary
ConstructorDescriptionEnumNode
(@NotNull ConfigurationNode<?> parent, @NotNull String name) Creates a new configuration node with an enum value. -
Method Summary
Methods inherited from class dev.satyrn.papermc.api.configuration.v1.ConfigurationNode
addChild, equals, getBasePath, getBasePath, getChildren, getComments, getComments, getConfig, getInlineComments, getInlineComments, getLogger, getName, getPath, getPath, getPlugin, getPriority, getSLF4JLogger, getValueNodeName, getValuePath, getValuePath, hasChildren, hasName, isSubNode, save, setComments, setComments, setConfigValue, setInlineComments, setInlineComments, setValue, toString, toString
-
Constructor Details
-
EnumNode
Creates a new configuration node with an enum value.- Parameters:
parent
- The parent container.name
- The node's name.- Since:
- 1.0.0
-
-
Method Details
-
value
Returns the enum value of the node.- Specified by:
value
in classConfigurationNode<E extends Enum<E>>
- Returns:
- The enum value.
- Since:
- 1.0.0
-
parse
Parses the enum value.- Parameters:
value
- The string value from the config file- Returns:
- The parsed enum value.
- Throws:
IllegalArgumentException
- Thrown when the enum value parses.- Since:
- 1.0.0
-
getDefault
Gets the default enum value.- Returns:
- The default enum value.
- Since:
- 1.0.0
-
defaultValue
Gets the default value of the node.- Specified by:
defaultValue
in classConfigurationNode<E extends Enum<E>>
- Returns:
- The default value.
- Since:
- 1.3.0
-