程序包 org.bukkit.configuration

# 接口 Configuration

所有超级接口:
  `ConfigurationSection`

所有已知实现类:
  `FileConfiguration`, `MemoryConfiguration`, `YamlConfiguration`

public interface Configuration extends ConfigurationSection
配置文件的基类.

原文: Represents a source of configurable options and settings

- ## 方法概要

  修饰符和类型
  方法
  说明
  `void`
  `addDefault(@NotNull String path, @Nullable Object value)`
  设置指定路径的缺省值.
  `void`
  `addDefaults(@NotNull Map<String,Object> defaults)`
  把指定map里面的键值都加入到缺省值列表.
  `void`
  `addDefaults(@NotNull Configuration defaults)`
  把指定 `Configuration` 全部加入到缺省值列表.
  `@Nullable Configuration`
  `getDefaults()`
  获取这个 `Configuration` 的缺省值 `Configuration`.
  `@NotNull ConfigurationOptions`
  `options()`
  获取这个 `Configuration` 的 `ConfigurationOptions`.
  `void`
  `setDefaults(@NotNull Configuration defaults)`
  设置新的缺省值列表.

  ### 从接口继承的方法 org.bukkit.configuration.ConfigurationSection

  `contains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getParent, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isSet, isString, isVector, set, setComments, setInlineComments`

- ## 方法详细资料

  - ### addDefault

    void addDefault(@NotNull @NotNull String path, @Nullable @Nullable Object value)
    设置指定路径的缺省值.

    如果没有默认的 `Configuration`. 那么将会建立一个新的 `MemoryConfiguration` 用于保存.

    如果值为 null ，该值将被从默认的配置源中删除.

    原文: Sets the default value of the given path as provided.

    If no source `Configuration` was provided as a default collection, then a new `MemoryConfiguration` will be created to hold the new default value.

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

    指定者:
      `addDefault` 在接口中 `ConfigurationSection`
    参数:
      `path` - 路径.
      `value` - 缺省值.
    抛出:
      `IllegalArgumentException` - 如果路径为 null .

  - ### addDefaults

    void addDefaults(@NotNull @NotNull Map<String,Object> defaults)
    把指定map里面的键值都加入到缺省值列表.

    如果没有缺省值 `Configuration`, 那么将会建立一个新的缺省值 `MemoryConfiguration` 用于保存.

    如果值为 null , 将会删除该路径上的缺省值.

    原文: Sets the default values of the given paths as provided.

    If no source `Configuration` was provided as a default collection, then a new `MemoryConfiguration` will be created to hold the new default values.

    参数:
      `defaults` - Map 的键是路径, 值是对应路径的值.
    抛出:
      `IllegalArgumentException` - 如果defaults为null.

  - ### addDefaults

    void addDefaults(@NotNull @NotNull Configuration defaults)
    把指定 `Configuration` 全部加入到缺省值列表.

    如果没有缺省值 `Configuration`, 那么将会建立一个新的 `MemoryConfiguration` 用于保存.

    你可以使用`setDefaults(org.bukkit.configuration.Configuration)`来设置缺省值列表来源.

    原文: Sets the default values of the given paths as provided.

    If no source `Configuration` was provided as a default collection, then a new `MemoryConfiguration` will be created to hold the new default value.

    If you require this, you should set the default source with `setDefaults(org.bukkit.configuration.Configuration)`.

    参数:
      `defaults` - A configuration holding a list of defaults to copy.
    抛出:
      `IllegalArgumentException` - Thrown if defaults is null or this.

  - ### setDefaults

    void setDefaults(@NotNull @NotNull Configuration defaults)
    设置新的缺省值列表.

    将直接替换原有的缺省值列表(如果有).

    原文: 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.

    参数:
      `defaults` - 新的 `Configuration` .
    抛出:
      `IllegalArgumentException` - 当参数为 null 或 defaults == getDefaults() 时, 抛出此异常.

  - ### getDefaults

    @Nullable @Nullable Configuration getDefaults()
    获取这个 `Configuration` 的缺省值 `Configuration`.

    如果设置过缺省值, 即使没有设置缺省值列表, 也会返回 `Configuration`.

    如果都没有, 则返回 null.

    原文: Gets the source `Configuration` for this configuration.

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

    返回:
      返回缺省值列表, 如果没有则返回 null.

  - ### options

    @NotNull @NotNull ConfigurationOptions options()
    获取这个 `Configuration` 的 `ConfigurationOptions`.

    如需修改配置,直接修改返回值即可.

    原文: Gets the `ConfigurationOptions` for this `Configuration`.

    All setters through this method are chainable.

    返回:
      这个配置文件的一些配置(格式之类的).