Interface MapConfiguration

All Known Implementing Classes:
TypedMapAccessor, YamlConfigurationAccessor

public interface MapConfiguration
This interface provides typed access to a map of key-value pairs, allowing retrieval of values of different types with or without default values if the key is not present in the map.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
    Retrieves a boolean value from the map based on the provided key.
    boolean
    getBoolean(String key, boolean defaultValue)
    Retrieves a boolean value from the map based on the provided key.
    double
    Retrieves a double value from the map based on the provided key.
    double
    getDouble(String key, double defaultValue)
    Retrieves a double value from the map based on the provided key.
    float
    Retrieves a float value from the map based on the provided key.
    float
    getFloat(String key, float defaultValue)
    Retrieves a float value from the map based on the provided key.
    int
    Retrieves an integer value from the map based on the provided key.
    int
    getInt(String key, int defaultValue)
    Retrieves an integer value from the map based on the provided key.
    Retrieves a list of integers from the map based on the provided key.
    getIntList(String key, List<Integer> defaultValue)
    Retrieves a list of integers from the map based on the provided key.
    List<?>
     
    long
    Retrieves a long value from the map based on the provided key.
    long
    getLong(String key, long defaultValue)
    Retrieves a long value from the map based on the provided key.
    Retrieves an object from the map based on the provided key.
    getObject(String key, Object defaultValue)
    Retrieves an object from the map based on the provided key.
    Retrieves a string value from the map based on the provided key.
    getString(String key, String defaultValue)
    Retrieves a string value from the map based on the provided key.
    Retrieves a list of strings from the map based on the provided key.
    getStringList(String key, List<String> defaultValue)
    Retrieves a list of strings from the map based on the provided key.
  • Method Details

    • getString

      String getString(String key)
      Retrieves a string value from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      Returns:
      The string value associated with the key or null if the key is not present.
    • getString

      String getString(String key, String defaultValue)
      Retrieves a string value from the map based on the provided key. If the key is not present, returns the specified default value.
      Parameters:
      key - The key to retrieve the value.
      defaultValue - The default value if the key is not present.
      Returns:
      The string value associated with the key or the default value.
    • getInt

      int getInt(String key)
      Retrieves an integer value from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      Returns:
      The integer value associated with the key or 0 if the key is not present.
    • getInt

      int getInt(String key, int defaultValue)
      Retrieves an integer value from the map based on the provided key. If the key is not present, returns the specified default value.
      Parameters:
      key - The key to retrieve the value.
      defaultValue - The default value if the key is not present.
      Returns:
      The integer value associated with the key or the default value.
    • getLong

      long getLong(String key)
      Retrieves a long value from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      Returns:
      The long value associated with the key or 0L if the key is not present.
    • getLong

      long getLong(String key, long defaultValue)
      Retrieves a long value from the map based on the provided key. If the key is not present, returns the specified default value.
      Parameters:
      key - The key to retrieve the value.
      defaultValue - The default value if the key is not present.
      Returns:
      The long value associated with the key or the default value.
    • getStringList

      List<String> getStringList(String key)
      Retrieves a list of strings from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      Returns:
      The list of strings associated with the key or an empty list if the key is not present.
    • getStringList

      List<String> getStringList(String key, List<String> defaultValue)
      Retrieves a list of strings from the map based on the provided key. If the key is not present, returns the specified default value.
      Parameters:
      key - The key to retrieve the value.
      defaultValue - The default value if the key is not present.
      Returns:
      The list of strings associated with the key or the default value.
    • getIntList

      List<Integer> getIntList(String key)
      Retrieves a list of integers from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      Returns:
      The list of integers associated with the key or an empty list if the key is not present.
    • getIntList

      List<Integer> getIntList(String key, List<Integer> defaultValue)
      Retrieves a list of integers from the map based on the provided key. If the key is not present, returns the specified default value.
      Parameters:
      key - The key to retrieve the value.
      defaultValue - The default value if the key is not present.
      Returns:
      The list of integers associated with the key or the default value.
    • getBoolean

      boolean getBoolean(String key)
      Retrieves a boolean value from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      Returns:
      The boolean value associated with the key or false if the key is not present.
    • getBoolean

      boolean getBoolean(String key, boolean defaultValue)
      Retrieves a boolean value from the map based on the provided key. If the key is not present, returns the specified default value.
      Parameters:
      key - The key to retrieve the value.
      defaultValue - The default value if the key is not present.
      Returns:
      The boolean value associated with the key or the default value.
    • getDouble

      double getDouble(String key)
      Retrieves a double value from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      Returns:
      The double value associated with the key or 0.0 if the key is not present.
    • getDouble

      double getDouble(String key, double defaultValue)
      Retrieves a double value from the map based on the provided key. If the key is not present, returns the specified default value.
      Parameters:
      key - The key to retrieve the value.
      defaultValue - The default value if the key is not present.
      Returns:
      The double value associated with the key or the default value.
    • getObject

      Object getObject(String key)
      Retrieves an object from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      Returns:
      The object associated with the key or null if the key is not present.
    • getObject

      Object getObject(String key, Object defaultValue)
      Retrieves an object from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      defaultValue - The default value if the key is not present.
      Returns:
      The object associated with the key or null if the key is not present.
    • getFloat

      float getFloat(String key)
      Retrieves a float value from the map based on the provided key.
      Parameters:
      key - The key to retrieve the value.
      Returns:
      The float value associated with the key or 0.0f if the key is not present.
    • getFloat

      float getFloat(String key, float defaultValue)
      Retrieves a float value from the map based on the provided key. If the key is not present, returns the specified default value.
      Parameters:
      key - The key to retrieve the value.
      defaultValue - The default value if the key is not present.
      Returns:
      The float value associated with the key or the default value.
    • getList

      List<?> getList(String key)
    • contains

      boolean contains(String key)