All Superinterfaces:
ConfigNode
All Known Implementing Classes:
BukkitConfig, BungeeConfig, ConfigurateConfig, GsonConfig

public interface Config extends ConfigNode
The root configuration interface, extending ConfigNode. Provides file-level operations beyond the node-based access.
  • Method Details

    • getPath

      default String[] getPath()
      Description copied from interface: ConfigNode
      Get the path relative to the origin node. When obtained from Config.node(), returns the full path from root. When obtained from ConfigNode.node() or getChildren(), returns the relative path.
      Specified by:
      getPath in interface ConfigNode
      Returns:
      the path segments
    • getParent

      default ConfigNode getParent()
      Description copied from interface: ConfigNode
      Get the parent node (the origin). When obtained from Config.node(), returns the Config (root node). When obtained from ConfigNode.node() or getChildren(), returns that ConfigNode.
      Specified by:
      getParent in interface ConfigNode
      Returns:
      the parent node
    • getConfig

      default Config getConfig()
      Description copied from interface: ConfigNode
      Get the root Config that owns this node
      Specified by:
      getConfig in interface ConfigNode
      Returns:
      the owning Config
    • hasChild

      default boolean hasChild()
      Description copied from interface: ConfigNode
      Check if this node has children
      Specified by:
      hasChild in interface ConfigNode
      Returns:
      true if this node has child nodes
    • getName

      String getName()
      Get the name of the configuration (typically the file name)
      Returns:
      the name
    • setup

      void setup()
      Set up the configuration (create file, load initial data)
    • save

      void save()
      Save the configuration to disk
    • reload

      void reload()
      Reload the configuration from disk
    • getOriginal

      Object getOriginal()
      Get the original underlying object (e.g., JsonObject, ConfigurationNode)
      Returns:
      the original instance
    • normalize

      Object normalize(Object object)
      Normalize a library-specific object to plain Java types
      Parameters:
      object - the object to normalize
      Returns:
      the normalized object
    • isNormalizable

      boolean isNormalizable(Object object)
      Check if the object can be normalized
      Parameters:
      object - the object
      Returns:
      true if it is normalizable