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

public abstract class TypedMapListNode<K,V> extends ConfigurationNode<List<Map<K,V>>>
Gets a map list from the config, using specified types instead of rawtypes.
Since:
1.3.0
Author:
Isabel Maskrey
  • 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

      @NotNull public @NotNull @Unmodifiable List<Map<K,V>> value()
      Gets the value of the configuration node.
      Specified by:
      value in class ConfigurationNode<List<Map<K,V>>>
      Returns:
      The value as a list of maps.
      Since:
      1.3.0
    • 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

      @NotNull public final @NotNull @Unmodifiable List<Map<K,V>> defaultValue()
      Gets the default value of the node.
      Specified by:
      defaultValue in class ConfigurationNode<List<Map<K,V>>>
      Returns:
      The value.
      Since:
      1.3.0