Class YamlFormat.Builder

java.lang.Object
com.github.siroshun09.configapi.format.yaml.YamlFormat.Builder
Enclosing class:
YamlFormat

public static final class YamlFormat.Builder extends Object
A builder of YamlFormat.
  • Method Details

    • flowStyle

      @Contract("_ -> this") @NotNull public @NotNull YamlFormat.Builder flowStyle(@Nullable org.yaml.snakeyaml.DumperOptions.FlowStyle flowStyle)
      Sets DumperOptions.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)
      Sets DumperOptions.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) is DumperOptions.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)
      Sets DumperOptions.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) is DumperOptions.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)
      Sets DumperOptions.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) is DumperOptions.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)
      Sets DumperOptions.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

      @Contract("_ -> this") @NotNull public @NotNull YamlFormat.Builder indent(int 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) is DumperOptions.FlowStyle.BLOCK

      Parameters:
      processComment - true to process comments, false to ignore comments
      Returns:
      this YamlFormat.Builder instance
    • build

      @NotNull public @NotNull YamlFormat build()
      Builds YamlFormat.
      Returns:
      a created YamlFormat