public interface Configuration extends ConfigurationSection
| Modifier and Type | Method and Description |
|---|---|
void |
addDefault(@NotNull String path,
@Nullable Object value)
Sets the default value of the given path as provided.
|
void |
addDefaults(@NotNull Configuration defs)
Sets the default values of the given paths as provided.
|
void |
addDefaults(@NotNull Map<String,Object> defs)
Sets the default values of the given paths as provided.
|
@Nullable Configuration |
getDefaults()
Gets the source
Configuration for this Configuration. |
@NotNull ConfigurationOptions |
getOptions()
Gets the
ConfigurationOptions for this Configuration. |
@NotNull ConfigurationOptions |
options()
Deprecated.
This method exists for backwards compatibility. Please use
getOptions() instead. |
void |
setDefaults(@NotNull Configuration defs)
Sets the source of all default values for this
Configuration. |
contains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByte, getByte, getByteList, getChar, getChar, getCharList, getComments, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInLineComments, getInt, getInt, getIntList, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getParent, getRoot, getSerializable, getSerializable, getShort, getShort, getShortList, getString, getString, getStringList, getValues, isBoolean, isByte, isChar, isConfigurationSection, isDouble, isFloat, isInt, isList, isLong, isSet, isShort, isString, set, setComments, setInLineCommentsvoid addDefault(@NotNull
@NotNull String path,
@Nullable
@Nullable Object value)
throws IllegalArgumentException
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 in interface ConfigurationSectionpath - Path of the value to set.value - Value to set the default to.IllegalArgumentException - Thrown if path is null.void addDefaults(@NotNull
@NotNull Map<String,Object> defs)
If no source Configuration was provided as a default
collection, then a new MemoryConfiguration will be created to
hold the new default values.
defs - A Map of Path->Values to add to the
defaults.void addDefaults(@NotNull
@NotNull Configuration defs)
If no source Configuration was provided as a default
collection, then a new MemoryConfiguration will be created to
hold the new default value.
This method will not hold a reference to the specified
Configuration, nor will it automatically update if that
Configuration ever changes. If you require this, you should set
the default source with setDefaults(Configuration).
defs - A Configuration holding a list of defaults to copy.void setDefaults(@NotNull
@NotNull Configuration defs)
Configuration.
If a previous source was set, or previous default values were defined, then they will not be copied to the new source.
defs - New source of default values for this Configuration.@Nullable @Nullable Configuration getDefaults()
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.
Configuration source for default values, or
null if none exist.@NotNull @NotNull ConfigurationOptions getOptions()
ConfigurationOptions for this Configuration.
All setters through this method are chainable.
ConfigurationOptions for this Configuration.@Deprecated @NotNull @NotNull ConfigurationOptions options()
getOptions() instead.
Please use getOptions() instead; it provides the
same functionality.
ConfigurationOptions for this Configuration.getOptions()Copyright © 2022 BSPF Systems, LLC. All rights reserved.