Class TypedMapListNode<K,V>
java.lang.Object
dev.satyrn.papermc.api.configuration.v1.ConfigurationNode<List<Map<K,V>>>
dev.satyrn.papermc.api.configuration.v1.TypedMapListNode<K,V>
- Type Parameters:
K
- The key type.V
- The value type.
- Direct Known Subclasses:
TypedMapListNode
Gets a map list from the config, using specified types instead of rawtypes.
- Since:
- 1.3.0
- Author:
- Isabel Maskrey
-
Constructor Summary
ConstructorDescriptionTypedMapListNode
(@NotNull ConfigurationNode<?> parent, @NotNull String name) Creates a new typed map list node. -
Method Summary
Modifier and TypeMethodDescriptionGets the default value of the node.protected K
Gets the value of a key in the map list.protected V
getValueFor
(@Nullable Object value) Gets the value of an object in the map list.value()
Gets the value of the configuration node.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
-
TypedMapListNode
public TypedMapListNode(@NotNull @NotNull ConfigurationNode<?> parent, @NotNull @NotNull String name) Creates a new typed map list node.- Parameters:
parent
- The parent container.name
- The name of the node.- Since:
- 1.3.0
-
-
Method Details
-
value
Gets the value of the configuration node. -
getValueFor
@Contract(value="null -> null; !null -> _", pure=true) @Nullable protected V getValueFor(@Nullable @Nullable Object value) Gets the value of an object in the map list.- Parameters:
value
- The object value.- Returns:
- The object as the given class.
- Since:
- 1.3.0
-
getKeyFor
@Contract(value="_ -> !null", pure=true) @NotNull protected K getKeyFor(@NotNull @NotNull Object key) throws IllegalArgumentException Gets the value of a key in the map list.- Parameters:
key
- The key value.- Returns:
- The key as the given class.
- Throws:
IllegalArgumentException
- If the key is null, or does not conform to the expected class K.- Since:
- 1.3.0
-
defaultValue
Gets the default value of the node.- Specified by:
defaultValue
in classConfigurationNode<List<Map<K,
V>>> - Returns:
- The value.
- Since:
- 1.3.0
-