Class ConfigHolder

java.lang.Object
se.itssimple.obsidianweave.data.ConfigHolder

public class ConfigHolder extends Object
Holds configuration entries for a specific mod in Obsidian Weave. Provides access to config values and entry lookup by key.
  • Constructor Details

    • ConfigHolder

      public ConfigHolder(String modId, List<ConfigEntry<?>> configEntryList)
      Constructs a config holder for the given mod ID and entries.
      Parameters:
      modId - The mod ID.
      configEntryList - The list of config entries.
  • Method Details

    • getModId

      public String getModId()
      Gets the mod ID for this config holder.
      Returns:
      The mod ID.
    • getAllEntries

      public List<ConfigEntry<?>> getAllEntries()
      Gets all config entries for this mod.
      Returns:
      List of config entries.
    • getEntry

      public <T> Optional<ConfigEntry<T>> getEntry(String key)
      Gets a config entry by key, if present.
      Type Parameters:
      T - The entry type.
      Parameters:
      key - The config key.
      Returns:
      Optional config entry.
    • getBoolean

      public boolean getBoolean(String key)
      Gets a boolean config value by key.
      Parameters:
      key - The config key.
      Returns:
      The boolean value, or false if not present.
    • getInteger

      public Integer getInteger(String key)
      Gets an integer config value by key.
      Parameters:
      key - The config key.
      Returns:
      The integer value, or 0 if not present.
    • getString

      public String getString(String key)
      Gets a string config value by key.
      Parameters:
      key - The config key.
      Returns:
      The string value, or empty string if not present.
    • getDouble

      public Double getDouble(String key)
      Gets a double config value by key.
      Parameters:
      key - The config key.
      Returns:
      The double value, or 0.0 if not present.