Class YamlFormat.Builder
- Enclosing class:
- YamlFormat
YamlFormat
.-
Method Summary
Modifier and TypeMethodDescription@NotNull YamlFormat.Builder
arrayFlowStyle
(org.yaml.snakeyaml.DumperOptions.FlowStyle flowStyle) SetsDumperOptions.FlowStyle
for arrays.@NotNull YamlFormat
build()
BuildsYamlFormat
.@NotNull YamlFormat.Builder
flowStyle
(org.yaml.snakeyaml.DumperOptions.FlowStyle flowStyle) SetsDumperOptions.FlowStyle
.@NotNull YamlFormat.Builder
indent
(int indent) Sets number of spaces as indentation.@NotNull YamlFormat.Builder
mapFlowStyle
(org.yaml.snakeyaml.DumperOptions.FlowStyle flowStyle) SetsDumperOptions.FlowStyle
for maps.@NotNull YamlFormat.Builder
processComment
(boolean processComment) Sets whether to process comments.@NotNull YamlFormat.Builder
scalarStyle
(org.yaml.snakeyaml.DumperOptions.ScalarStyle scalarStyle) SetsDumperOptions.ScalarStyle
.@NotNull YamlFormat.Builder
sequenceFlowStyle
(org.yaml.snakeyaml.DumperOptions.FlowStyle flowStyle) SetsDumperOptions.FlowStyle
for sequences.
-
Method Details
-
flowStyle
@Contract("_ -> this") @NotNull public @NotNull YamlFormat.Builder flowStyle(@Nullable org.yaml.snakeyaml.DumperOptions.FlowStyle flowStyle) SetsDumperOptions.FlowStyle
.Passing
null
to set the default style (DumperOptions.FlowStyle.BLOCK
.- Parameters:
flowStyle
-DumperOptions.FlowStyle
or null to set the default style- Returns:
- this
YamlFormat.Builder
instance
-
arrayFlowStyle
@Contract("_ -> this") @NotNull public @NotNull YamlFormat.Builder arrayFlowStyle(@Nullable org.yaml.snakeyaml.DumperOptions.FlowStyle flowStyle) SetsDumperOptions.FlowStyle
for arrays.Passing
null
to set the default style (DumperOptions.FlowStyle.FLOW
.This style is only applied when the root style (set by
flowStyle(DumperOptions.FlowStyle)
isDumperOptions.FlowStyle.BLOCK
- Parameters:
flowStyle
-DumperOptions.FlowStyle
or null to set the default style- Returns:
- this
YamlFormat.Builder
instance
-
sequenceFlowStyle
@Contract("_ -> this") @NotNull public @NotNull YamlFormat.Builder sequenceFlowStyle(@Nullable org.yaml.snakeyaml.DumperOptions.FlowStyle flowStyle) SetsDumperOptions.FlowStyle
for sequences.Passing
null
to set the default style (DumperOptions.FlowStyle.BLOCK
.This style is only applied when the root style (set by
flowStyle(DumperOptions.FlowStyle)
isDumperOptions.FlowStyle.BLOCK
- Parameters:
flowStyle
-DumperOptions.FlowStyle
or null to set the default style- Returns:
- this
YamlFormat.Builder
instance
-
mapFlowStyle
@Contract("_ -> this") @NotNull public @NotNull YamlFormat.Builder mapFlowStyle(@Nullable org.yaml.snakeyaml.DumperOptions.FlowStyle flowStyle) SetsDumperOptions.FlowStyle
for maps.Passing
null
to set the default style (DumperOptions.FlowStyle.BLOCK
.This style is only applied when the root style (set by
flowStyle(DumperOptions.FlowStyle)
isDumperOptions.FlowStyle.BLOCK
- Parameters:
flowStyle
-DumperOptions.FlowStyle
or null to set the default style- Returns:
- this
YamlFormat.Builder
instance
-
scalarStyle
@Contract("_ -> this") @NotNull public @NotNull YamlFormat.Builder scalarStyle(@Nullable org.yaml.snakeyaml.DumperOptions.ScalarStyle scalarStyle) SetsDumperOptions.ScalarStyle
.Passing
null
to set the default style (DumperOptions.ScalarStyle.PLAIN
.- Parameters:
scalarStyle
-DumperOptions.ScalarStyle
or null to set the default style- Returns:
- this
YamlFormat.Builder
instance
-
indent
Sets number of spaces as indentation.Passing 0 or negative value to set the default indent (2).
- Parameters:
indent
- number of spaces or 0/negative value to set default value- Returns:
- this
YamlFormat.Builder
instance
-
processComment
@Contract("_ -> this") @NotNull public @NotNull YamlFormat.Builder processComment(boolean processComment) Sets whether to process comments.Node that the comments will be processed when
flowStyle(DumperOptions.FlowStyle)
isDumperOptions.FlowStyle.BLOCK
- Parameters:
processComment
-true
to process comments,false
to ignore comments- Returns:
- this
YamlFormat.Builder
instance
-
build
BuildsYamlFormat
.- Returns:
- a created
YamlFormat
-