Interface GrechConfigFile

  • All Known Subinterfaces:
    LocationConfigParser
    All Known Implementing Classes:
    GrechConfig

    public interface GrechConfigFile
    Grech config plugin file handler.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default boolean existsDefaultConfig()
      Checks if the plugin has default config resources for this file name.
      default boolean fileExists()
      Checks if the plugin data folder contains this file on disk.
      @NotNull org.bukkit.configuration.file.FileConfiguration getConfig()
      Obtains Bukkit FileConfiguration ready to use instance.
      @NotNull java.io.File getConfigFile()
      Obtains this config instance disk file.
      @NotNull org.bukkit.plugin.Plugin getPlugin()
      Obtains the plugin where this config comes from.
      default void save()
      Saves this configuration to disk file.
      default void saveDefaultConfig()
      Copy default config data from resources if not exists.
      default void set​(java.lang.String path, java.lang.Object value)
      Sets a value to provided path using Bukkit FileConfiguration API.
    • Method Detail

      • getPlugin

        @NotNull
        @NotNull org.bukkit.plugin.Plugin getPlugin()
        Obtains the plugin where this config comes from.
        Returns:
        Bukkit plugin that created this config file.
      • getConfig

        @NotNull
        @NotNull org.bukkit.configuration.file.FileConfiguration getConfig()
        Obtains Bukkit FileConfiguration ready to use instance.
        Returns:
        Bukkit FileConfiguration instance for this config file.
      • getConfigFile

        @NotNull
        @NotNull java.io.File getConfigFile()
        Obtains this config instance disk file.
        Returns:
        This config instance disk file.
      • set

        default void set​(java.lang.String path,
                         java.lang.Object value)
        Sets a value to provided path using Bukkit FileConfiguration API.
        Parameters:
        path - YAML path to store the object.
        value - Object value to store at provided path.
      • save

        default void save()
        Saves this configuration to disk file.
      • saveDefaultConfig

        default void saveDefaultConfig()
        Copy default config data from resources if not exists. It will create an empty file in case no default resources found.
      • existsDefaultConfig

        default boolean existsDefaultConfig()
        Checks if the plugin has default config resources for this file name.
        Returns:
        true in case the plugin has default config resources.
      • fileExists

        default boolean fileExists()
        Checks if the plugin data folder contains this file on disk.
        Returns:
        true in case it already exists.