Class BaseConfig.MapConfigSection

java.lang.Object
fr.hytale.loader.config.BaseConfig.MapConfigSection
All Implemented Interfaces:
ConfigSection
Enclosing class:
BaseConfig

protected static class BaseConfig.MapConfigSection extends Object implements ConfigSection
Inner class for config sections backed by a Map.

Provides a ConfigSection view over a standard Map, allowing identical access patterns for nested data.

Since:
1.0.4
Version:
1.0.4
Author:
HytaleLoader
  • Constructor Details

    • MapConfigSection

      public MapConfigSection(Map<String,Object> data)
      Creates a new config section.
      Parameters:
      data - the map backing this section
  • Method Details

    • get

      public Object get(String path)
      Gets a value from this section.
      Specified by:
      get in interface ConfigSection
      Parameters:
      path - the path relative to this section
      Returns:
      the value, or null
    • get

      public Object get(String path, Object def)
      Gets a value from this section with a default.
      Specified by:
      get in interface ConfigSection
      Parameters:
      path - the path relative to this section
      def - the default value
      Returns:
      the value, or default
    • getString

      public String getString(String path)
      Gets a String from this section.
      Specified by:
      getString in interface ConfigSection
      Parameters:
      path - the path relative to this section
      Returns:
      the string value
    • getString

      public String getString(String path, String def)
      Gets a String from this section with a default.
      Specified by:
      getString in interface ConfigSection
      Parameters:
      path - the path relative to this section
      def - the default string
      Returns:
      the string value, or default
    • getInt

      public int getInt(String path)
      Gets an int from this section.
      Specified by:
      getInt in interface ConfigSection
      Parameters:
      path - the path relative to this section
      Returns:
      the int value
    • getInt

      public int getInt(String path, int def)
      Gets an int from this section with a default.
      Specified by:
      getInt in interface ConfigSection
      Parameters:
      path - the path relative to this section
      def - the default int
      Returns:
      the int value, or default
    • getDouble

      public double getDouble(String path)
      Gets a double from this section.
      Specified by:
      getDouble in interface ConfigSection
      Parameters:
      path - the path relative to this section
      Returns:
      the double value
    • getDouble

      public double getDouble(String path, double def)
      Gets a double from this section with a default.
      Specified by:
      getDouble in interface ConfigSection
      Parameters:
      path - the path relative to this section
      def - the default double
      Returns:
      the double value, or default
    • getBoolean

      public boolean getBoolean(String path)
      Gets a boolean from this section.
      Specified by:
      getBoolean in interface ConfigSection
      Parameters:
      path - the path relative to this section
      Returns:
      the boolean value
    • getBoolean

      public boolean getBoolean(String path, boolean def)
      Gets a boolean from this section with a default.
      Specified by:
      getBoolean in interface ConfigSection
      Parameters:
      path - the path relative to this section
      def - the default boolean
      Returns:
      the boolean value, or default
    • getSection

      public ConfigSection getSection(String path)
      Gets a nested section from this section.
      Specified by:
      getSection in interface ConfigSection
      Parameters:
      path - the path to the nested section
      Returns:
      the nested ConfigSection, or null
    • getKeys

      public Set<String> getKeys(boolean deep)
      Gets keys from this section.
      Specified by:
      getKeys in interface ConfigSection
      Parameters:
      deep - if true, includes recursive keys
      Returns:
      a Set of keys
    • getValues

      public Map<String,Object> getValues()
      Gets the values of this section as a Map.
      Specified by:
      getValues in interface ConfigSection
      Returns:
      a Map of the section's data
    • contains

      public boolean contains(String path)
      Checks if a value exists in this section.
      Specified by:
      contains in interface ConfigSection
      Parameters:
      path - the path to check
      Returns:
      true if found