Class YamlConfigurationAccessor

java.lang.Object
fr.maxlego08.menu.api.utils.YamlConfigurationAccessor
All Implemented Interfaces:
MapConfiguration

public class YamlConfigurationAccessor extends Object implements MapConfiguration
  • Constructor Details

    • YamlConfigurationAccessor

      public YamlConfigurationAccessor(org.bukkit.configuration.file.YamlConfiguration yamlConfig, String path)
  • Method Details

    • getString

      public String getString(String key)
      Description copied from interface: MapConfiguration
      Retrieves a string value from the map based on the provided key.
      Specified by:
      getString in interface MapConfiguration
      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

      public String getString(String key, String defaultValue)
      Description copied from interface: MapConfiguration
      Retrieves a string value from the map based on the provided key. If the key is not present, returns the specified default value.
      Specified by:
      getString in interface MapConfiguration
      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

      public int getInt(String key)
      Description copied from interface: MapConfiguration
      Retrieves an integer value from the map based on the provided key.
      Specified by:
      getInt in interface MapConfiguration
      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

      public int getInt(String key, int defaultValue)
      Description copied from interface: MapConfiguration
      Retrieves an integer value from the map based on the provided key. If the key is not present, returns the specified default value.
      Specified by:
      getInt in interface MapConfiguration
      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

      public long getLong(String key)
      Description copied from interface: MapConfiguration
      Retrieves a long value from the map based on the provided key.
      Specified by:
      getLong in interface MapConfiguration
      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

      public long getLong(String key, long defaultValue)
      Description copied from interface: MapConfiguration
      Retrieves a long value from the map based on the provided key. If the key is not present, returns the specified default value.
      Specified by:
      getLong in interface MapConfiguration
      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

      public List<String> getStringList(String key)
      Description copied from interface: MapConfiguration
      Retrieves a list of strings from the map based on the provided key.
      Specified by:
      getStringList in interface MapConfiguration
      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

      public List<String> getStringList(String key, List<String> defaultValue)
      Description copied from interface: MapConfiguration
      Retrieves a list of strings from the map based on the provided key. If the key is not present, returns the specified default value.
      Specified by:
      getStringList in interface MapConfiguration
      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

      public List<Integer> getIntList(String key)
      Description copied from interface: MapConfiguration
      Retrieves a list of integers from the map based on the provided key.
      Specified by:
      getIntList in interface MapConfiguration
      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

      public List<Integer> getIntList(String key, List<Integer> defaultValue)
      Description copied from interface: MapConfiguration
      Retrieves a list of integers from the map based on the provided key. If the key is not present, returns the specified default value.
      Specified by:
      getIntList in interface MapConfiguration
      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

      public boolean getBoolean(String key)
      Description copied from interface: MapConfiguration
      Retrieves a boolean value from the map based on the provided key.
      Specified by:
      getBoolean in interface MapConfiguration
      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

      public boolean getBoolean(String key, boolean defaultValue)
      Description copied from interface: MapConfiguration
      Retrieves a boolean value from the map based on the provided key. If the key is not present, returns the specified default value.
      Specified by:
      getBoolean in interface MapConfiguration
      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

      public double getDouble(String key)
      Description copied from interface: MapConfiguration
      Retrieves a double value from the map based on the provided key.
      Specified by:
      getDouble in interface MapConfiguration
      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

      public double getDouble(String key, double defaultValue)
      Description copied from interface: MapConfiguration
      Retrieves a double value from the map based on the provided key. If the key is not present, returns the specified default value.
      Specified by:
      getDouble in interface MapConfiguration
      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

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

      public Object getObject(String key, Object defaultValue)
      Description copied from interface: MapConfiguration
      Retrieves an object from the map based on the provided key.
      Specified by:
      getObject in interface MapConfiguration
      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

      public float getFloat(String key)
      Description copied from interface: MapConfiguration
      Retrieves a float value from the map based on the provided key.
      Specified by:
      getFloat in interface MapConfiguration
      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

      public float getFloat(String key, float defaultValue)
      Description copied from interface: MapConfiguration
      Retrieves a float value from the map based on the provided key. If the key is not present, returns the specified default value.
      Specified by:
      getFloat in interface MapConfiguration
      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

      public List<?> getList(String key)
      Specified by:
      getList in interface MapConfiguration
    • contains

      public boolean contains(String key)
      Specified by:
      contains in interface MapConfiguration