Class ConfigEntry<T>

java.lang.Object
se.itssimple.obsidianweave.data.ConfigEntry<T>
Type Parameters:
T - The type of the config value.

public class ConfigEntry<T> extends Object
Represents a single configuration entry for a mod in Obsidian Weave. Stores key, type, default value, language keys, and platform-specific binding.
  • Constructor Details

    • ConfigEntry

      public ConfigEntry(String key, Supplier<T> defaultValueSupplier, Class<T> type)
      Constructs a config entry with the given key, default value supplier, and type.
      Parameters:
      key - The config key.
      defaultValueSupplier - The supplier for the default value.
      type - The type of the config value.
  • Method Details

    • getKey

      public String getKey()
      Gets the config key.
      Returns:
      The config key.
    • getDefaultValueSupplier

      public Supplier<T> getDefaultValueSupplier()
      Gets the supplier for the default value.
      Returns:
      The default value supplier.
    • getType

      public Class<T> getType()
      Gets the type of the config value.
      Returns:
      The value type.
    • getDefaultValue

      public T getDefaultValue()
      Gets the default value for this entry.
      Returns:
      The default value.
    • getNameLangKey

      public String getNameLangKey()
      Gets the language key for the entry name.
      Returns:
      The name language key.
    • setNameLangKey

      public ConfigEntry<T> setNameLangKey(String nameLangKey)
      Sets the language key for the entry name.
      Parameters:
      nameLangKey - The name language key.
      Returns:
      This config entry.
    • getCommentLangKey

      public String getCommentLangKey()
      Gets the language key for the entry comment/tooltip.
      Returns:
      The comment language key.
    • setCommentLangKey

      public ConfigEntry<T> setCommentLangKey(String commentLangKey)
      Sets the language key for the entry comment/tooltip.
      Parameters:
      commentLangKey - The comment language key.
      Returns:
      This config entry.
    • getValue

      public T getValue()
      Gets the current value of this config entry from the platform helper.
      Returns:
      The config value.
    • setValue

      public void setValue(T value)
      Sets the value of this config entry using the platform helper.
      Parameters:
      value - The value to set.
    • getInternalCachedValue

      public T getInternalCachedValue()
      Gets the internal cached value for this entry.
      Returns:
      The cached value.
    • setInternalCachedValue

      public void setInternalCachedValue(T internalCachedValue)
      Sets the internal cached value for this entry.
      Parameters:
      internalCachedValue - The value to cache.
    • getPlatformBinding

      public Object getPlatformBinding()
      Gets the platform-specific binding for this entry.
      Returns:
      The platform binding object.
    • setPlatformBinding

      public void setPlatformBinding(Object platformBinding)
      Sets the platform-specific binding for this entry.
      Parameters:
      platformBinding - The platform binding object.