java.lang.Object
io.github.monsieurdoceo.filizer.storage.infrastructure.FileReader

public final class FileReader extends Object
Provides access to a managed file configuration.

Offers convenient methods for retrieving values, configuration sections, and keys from a FileConfiguration.

  • Constructor Details

    • FileReader

      public FileReader(org.bukkit.configuration.file.FileConfiguration config)
      Creates a new FileReader from a configuration instance.
      Parameters:
      config - the backing configuration
  • Method Details

    • get

      public Object get(String path)
      Retrieves a raw value from the configuration.
      Parameters:
      path - the configuration path
      Returns:
      the stored value, or null if absent
    • getString

      public String getString(String path)
      Retrieves a string value from the configuration.
      Parameters:
      path - the configuration path
      Returns:
      the stored string, or null if absent
    • getInt

      public int getInt(String path)
      Retrieves an integer value from the configuration.

      If the path is absent or not an integer, 0 is returned.

      Parameters:
      path - the configuration path
      Returns:
      the stored integer value
    • getDouble

      public double getDouble(String path)
      Retrieves an double value from the configuration.

      If the path is absent or not an integer, 0.0 is returned.

      Parameters:
      path - the configuration path
      Returns:
      the stored integer value
    • getStringList

      public List<String> getStringList(String path)
      Retrieves a string list from the configuration.
      Parameters:
      path - the configuration path
      Returns:
      the stored list, or null if absent
    • getIntegerList

      public List<Integer> getIntegerList(String path)
      Retrieves an integer list from the configuration.
      Parameters:
      path - the configuration path
      Returns:
      the stored list, or null if absent
    • getSection

      public org.bukkit.configuration.ConfigurationSection getSection(String path)
      Retrieves a configuration section.
      Parameters:
      path - the configuration path
      Returns:
      the matching section, or null if absent
    • getKeys

      public Set<String> getKeys(boolean deep)
      Retrieves all keys from the root configuration.
      Parameters:
      deep - whether nested keys should be included
      Returns:
      a set containing configuration keys
    • getKeys

      public Set<String> getKeys(String path, boolean deep)
      Retrieves keys from a specific configuration section.

      If the provided path is invalid or absent, root configuration keys are returned instead.

      Parameters:
      path - the configuration section path
      deep - whether nested keys should be included
      Returns:
      a set containing matching keys, or an empty set if the section does not exist
    • has

      public boolean has(String path)
      Checks whether a configuration path exists.
      Parameters:
      path - the configuration path
      Returns:
      true if the path exists, otherwise false