public class FileConfigurationOptions extends MemoryConfigurationOptions
FileConfiguration
Modifier | Constructor and Description |
---|---|
protected |
FileConfigurationOptions(MemoryConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
FileConfiguration |
configuration()
Returns the
Configuration that this object is responsible for. |
FileConfigurationOptions |
copyDefaults(boolean value)
Sets if the
Configuration should copy values from its default
Configuration directly. |
boolean |
copyHeader()
Deprecated.
Call
parseComments() instead. |
FileConfigurationOptions |
copyHeader(boolean value)
Deprecated.
Call
parseComments(boolean) instead. |
List<String> |
getFooter()
Gets the footer that will be applied to the bottom of the saved output.
|
List<String> |
getHeader()
Gets the header that will be applied to the top of the saved output.
|
String |
header()
Deprecated.
use getHeader() instead.
|
FileConfigurationOptions |
header(String value)
Deprecated.
use setHeader() instead
|
boolean |
parseComments()
Gets whether or not comments should be loaded and saved.
|
MemoryConfigurationOptions |
parseComments(boolean value)
Sets whether or not comments should be loaded and saved.
|
FileConfigurationOptions |
pathSeparator(char value)
Sets the char that will be used to separate
ConfigurationSection s |
FileConfigurationOptions |
setFooter(List<String> value)
Sets the footer that will be applied to the bottom of the saved output.
|
FileConfigurationOptions |
setHeader(List<String> value)
Sets the header that will be applied to the top of the saved output.
|
copyDefaults, pathSeparator
protected FileConfigurationOptions(@NotNull MemoryConfiguration configuration)
@NotNull public FileConfiguration configuration()
ConfigurationOptions
Configuration
that this object is responsible for.configuration
in class MemoryConfigurationOptions
@NotNull public FileConfigurationOptions copyDefaults(boolean value)
ConfigurationOptions
Configuration
should copy values from its default
Configuration
directly.
If this is true, all values in the default Configuration will be
directly copied, making it impossible to distinguish between values
that were set and values that are provided by default. As a result,
ConfigurationSection.contains(java.lang.String)
will always
return the same value as ConfigurationSection.isSet(java.lang.String)
. The default value is
false.
copyDefaults
in class MemoryConfigurationOptions
value
- Whether or not defaults are directly copied@NotNull public FileConfigurationOptions pathSeparator(char value)
ConfigurationOptions
ConfigurationSection
s
This value does not affect how the Configuration
is stored,
only in how you access the data. The default value is '.'.
pathSeparator
in class MemoryConfigurationOptions
value
- Path separator@NotNull public List<String> getHeader()
This header will be commented out and applied directly at the top of
the generated output of the FileConfiguration
. It is not
required to include a newline at the end of the header as it will
automatically be applied, but you may include one if you wish for extra
spacing.
If no comments exist, an empty list will be returned. A null entry represents an empty line and an empty String represents an empty comment line.
@NotNull @Deprecated public String header()
@NotNull public FileConfigurationOptions setHeader(@Nullable List<String> value)
This header will be commented out and applied directly at the top of
the generated output of the FileConfiguration
. It is not
required to include a newline at the end of the header as it will
automatically be applied, but you may include one if you wish for extra
spacing.
If no comments exist, an empty list will be returned. A null entry represents an empty line and an empty String represents an empty comment line.
value
- New header, every entry represents one line.@NotNull @Deprecated public FileConfigurationOptions header(@Nullable String value)
value
- The string header.@NotNull public List<String> getFooter()
This footer will be commented out and applied directly at the bottom of
the generated output of the FileConfiguration
. It is not required
to include a newline at the beginning of the footer as it will
automatically be applied, but you may include one if you wish for extra
spacing.
If no comments exist, an empty list will be returned. A null entry represents an empty line and an empty String represents an empty comment line.
@NotNull public FileConfigurationOptions setFooter(@Nullable List<String> value)
This footer will be commented out and applied directly at the bottom of
the generated output of the FileConfiguration
. It is not required
to include a newline at the beginning of the footer as it will
automatically be applied, but you may include one if you wish for extra
spacing.
If no comments exist, an empty list will be returned. A null entry represents an empty line and an empty String represents an empty comment line.
value
- New footer, every entry represents one line.public boolean parseComments()
Defaults to true.
@NotNull public MemoryConfigurationOptions parseComments(boolean value)
Defaults to true.
value
- Whether or not comments are parsed.@Deprecated public boolean copyHeader()
parseComments()
instead.@NotNull @Deprecated public FileConfigurationOptions copyHeader(boolean value)
parseComments(boolean)
instead.value
- Should comments be parsed.Copyright © 2022. All rights reserved.