public class YamlFileWrapper extends org.simpleyaml.configuration.ConfigurationWrapper<YamlFile>
yamlFile.path("test.hello")
.set("Hello")
.comment("Block comment")
.commentSide("Side comment");
YamlFile.path(String)
Modifier | Constructor and Description |
---|---|
|
YamlFileWrapper(YamlFile configuration,
String path) |
protected |
YamlFileWrapper(YamlFile configuration,
String path,
YamlFileWrapper parent) |
Modifier and Type | Method and Description |
---|---|
YamlFileWrapper |
addDefault(Object value) |
YamlFileWrapper |
addDefault(String child,
Object value) |
YamlFileWrapper |
blankLine()
Set a blank line at the beginning of the block comment.
|
YamlFileWrapper |
comment(String comment)
Set a block comment above the section or value selected by path.
|
YamlFileWrapper |
comment(String comment,
YamlCommentFormat yamlCommentFormat)
Set a block comment to the section or value selected by path.
|
YamlFileWrapper |
comment(String comment,
YamlCommentFormatter yamlCommentFormatter)
Set a block comment to the section or value selected by path.
|
YamlFileWrapper |
commentSide(String comment)
Set a side comment above the section or value selected by path.
|
YamlFileWrapper |
commentSide(String comment,
YamlCommentFormat yamlCommentFormat)
Set a side comment to the section or value selected by path.
|
YamlFileWrapper |
commentSide(String comment,
YamlCommentFormatter yamlCommentFormatter)
Set a side comment to the section or value selected by path.
|
YamlFileWrapper |
createSection() |
YamlFileWrapper |
createSection(String child) |
YamlFileWrapper |
parent() |
YamlFileWrapper |
path(String path) |
YamlFileWrapper |
set(Object value) |
YamlFileWrapper |
set(Object value,
QuoteStyle quoteStyle)
Set the given value to this path.
|
YamlFileWrapper |
setChild(String child,
Object value) |
YamlFileWrapper |
setChild(String child,
Object value,
QuoteStyle quoteStyle)
Set the given value to the provided child path.
|
protected YamlFileWrapper(YamlFile configuration, String path, YamlFileWrapper parent)
public YamlFileWrapper comment(String comment)
YamlConfiguration.options()
YamlConfigurationOptions.commentFormatter()
.comment
- the block comment to add, # character is not neededpublic YamlFileWrapper comment(String comment, YamlCommentFormatter yamlCommentFormatter)
YamlCommentFormatter
.comment
- the block comment to add, # prefix is not neededyamlCommentFormatter
- the comment formatter to usepublic YamlFileWrapper comment(String comment, YamlCommentFormat yamlCommentFormat)
YamlCommentFormat
.comment
- the block comment to add, # prefix is not neededyamlCommentFormat
- the comment format to usepublic YamlFileWrapper commentSide(String comment)
YamlConfiguration.options()
YamlConfigurationOptions.commentFormatter()
.comment
- the side comment to add, # symbol is not neededpublic YamlFileWrapper commentSide(String comment, YamlCommentFormatter yamlCommentFormatter)
YamlCommentFormatter
.comment
- the side comment to add, # prefix is not neededyamlCommentFormatter
- the comment formatter to usepublic YamlFileWrapper commentSide(String comment, YamlCommentFormat yamlCommentFormat)
YamlCommentFormat
.comment
- the side to add, # prefix is not neededyamlCommentFormat
- the comment format to usepublic YamlFileWrapper blankLine()
public YamlFileWrapper path(String path)
path
in class org.simpleyaml.configuration.ConfigurationWrapper<YamlFile>
public YamlFileWrapper set(Object value)
set
in class org.simpleyaml.configuration.ConfigurationWrapper<YamlFile>
public YamlFileWrapper setChild(String child, Object value)
setChild
in class org.simpleyaml.configuration.ConfigurationWrapper<YamlFile>
public YamlFileWrapper set(Object value, QuoteStyle quoteStyle)
The value will be represented with the specified quote style in the configuration file.
Any existing entry will be replaced, regardless of what the new value is. Null value is valid and will not remove the key, this is different toset(Object)
.
Instead, a null value will be written as a yaml empty null value.value
- new value to set the path to.quoteStyle
- the quote style to use.public YamlFileWrapper setChild(String child, Object value, QuoteStyle quoteStyle)
The value will be represented with the specified quote style in the configuration file.
Any existing entry will be replaced, regardless of what the new value is. Null value is valid and will not remove the key, this is different tosetChild(String, Object)
.
Instead, a null value will be written as a yaml empty null value.child
- the child path of this section path.value
- new value to set the path to.quoteStyle
- the quote style to use.public YamlFileWrapper addDefault(Object value)
addDefault
in class org.simpleyaml.configuration.ConfigurationWrapper<YamlFile>
public YamlFileWrapper addDefault(String child, Object value)
addDefault
in class org.simpleyaml.configuration.ConfigurationWrapper<YamlFile>
public YamlFileWrapper createSection()
createSection
in class org.simpleyaml.configuration.ConfigurationWrapper<YamlFile>
public YamlFileWrapper createSection(String child)
createSection
in class org.simpleyaml.configuration.ConfigurationWrapper<YamlFile>
public YamlFileWrapper parent()
parent
in class org.simpleyaml.configuration.ConfigurationWrapper<YamlFile>
Copyright © 2023. All rights reserved.