All Superinterfaces:
ConfigurationSection
All Known Implementing Classes:
FileConfiguration, MemoryConfiguration, YamlConfiguration

public interface Configuration extends ConfigurationSection
Represents a source of configurable options and settings.

Synchronized with the commit on 28-April-2019.

  • Method Details

    • addDefault

      void addDefault(@NotNull @NotNull String path, @Nullable @Nullable Object value) throws IllegalArgumentException
      Sets the default value of the given path as provided.

      If no source configuration was provided as a default collection, then a new memory configuration will be created to hold the given default value.

      If value is null, the value will be removed from the default configuration source.

      Specified by:
      addDefault in interface ConfigurationSection
      Parameters:
      path - The path of the value to set.
      value - The value to set the default to.
      Throws:
      IllegalArgumentException - Thrown if the path is null.
    • addDefaults

      void addDefaults(@NotNull @NotNull Map<String,Object> defs)
      Sets the default values of the given paths as provided.

      If no source configuration was provided as a default collection, then a new memory configuration will be created to hold the given default values.

      Parameters:
      defs - A map of paths to values to add to the defaults.
    • addDefaults

      void addDefaults(@NotNull @NotNull Configuration defs)
      Sets the default values of the given paths as provided.

      If no source configuration was provided as a default collection, then a new memory configuration will be created to hold the given default values.

      This method will not hold a reference to the given configuration, nor will it automatically update if the given configuration ever changes. If the automatic updates are required, please set the default source with setDefaults(Configuration).

      Parameters:
      defs - A configuration holding a map of defaults to copy.
    • setDefaults

      void setDefaults(@NotNull @NotNull Configuration defs)
      Sets the source of all default values for this configuration.

      If a previous source was set, or previous default values were defined, then they will not be copied to the new source.

      Parameters:
      defs - New source of default values for this configuration.
    • getDefaults

      @Nullable @Nullable Configuration getDefaults()
      Gets the default configuration for this configuration.

      If no configuration source was set, but default values were added, then a memory configuration will be returned. If no source was set and no defaults were set, then this method will return null.

      Returns:
      The configuration source for default values, or null if none exist.
    • getOptions

      @NotNull @NotNull ConfigurationOptions getOptions()
      Gets the options for this configuration.

      All setters through this method are chainable.

      Returns:
      The options for this configuration.