Class YamlMurmel.Builder
java.lang.Object
de.murmelmeister.library.configuration.YamlMurmel.Builder
- Enclosing class:
YamlMurmel
A Builder class for constructing instances of YamlMurmel with customizable options.
This class allows setting various parameters such as indentation, flow style, width,
comment processing, duplicate key handling, and more.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final Stringprivate intprivate intprivate booleanprivate booleanprivate intprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowDuplicateKeys(boolean allowDuplicateKeys) Configures whether duplicate keys are allowed in the data structure being processed.build()Builds and returns a new instance of YamlMurmel configured with the current state of the Builder instance.indent(int indent) Sets the indent size to be used and returns the Builder instance.maxAliasesForCollections(int maxAliasesForCollections) Sets the maximum allowed aliases for collections and returns the Builder instance.prettyFlow(boolean prettyFlow) Configures whether the flow presentation should be formatted in a "pretty" style.processComments(boolean processComments) Configures whether comments should be processed and included during the building process.width(int width) Sets the maximum width for formatting and returns the Builder instance.wrappedToRootException(boolean wrappedToRootException) Configures whether exceptions should be wrapped to root exceptions during processing.
-
Field Details
-
fileName
-
indent
private int indent -
prettyFlow
private boolean prettyFlow -
width
private int width -
processComments
private boolean processComments -
allowDuplicateKeys
private boolean allowDuplicateKeys -
maxAliasesForCollections
private int maxAliasesForCollections -
wrappedToRootException
private boolean wrappedToRootException
-
-
Constructor Details
-
Builder
Constructs a new Builder instance with the specified file name.- Parameters:
fileName- The name of the file to be associated with this Builder
-
-
Method Details
-
indent
Sets the indent size to be used and returns the Builder instance.- Parameters:
indent- The number of spaces to use for indentation.- Returns:
- The Builder instance with the updated indent setting.
-
prettyFlow
Configures whether the flow presentation should be formatted in a "pretty" style.- Parameters:
prettyFlow- A boolean indicating whether to enable or disable pretty flow formatting.- Returns:
- The Builder instance with the updated pretty flow setting.
-
width
Sets the maximum width for formatting and returns the Builder instance.- Parameters:
width- The maximum width to be used for formatting.- Returns:
- The Builder instance with the updated width setting.
-
processComments
Configures whether comments should be processed and included during the building process.- Parameters:
processComments- A boolean indicating whether to enable or disable processing of comments.- Returns:
- The Builder instance with the updated process comments setting.
-
allowDuplicateKeys
Configures whether duplicate keys are allowed in the data structure being processed.- Parameters:
allowDuplicateKeys- A boolean indicating whether to allow or disallow duplicate keys.- Returns:
- The Builder instance with the updated allows duplicate keys setting.
-
maxAliasesForCollections
Sets the maximum allowed aliases for collections and returns the Builder instance.- Parameters:
maxAliasesForCollections- The maximum number of aliases permitted for collections.- Returns:
- The Builder instance with the updated maximum aliases for collection setting.
-
wrappedToRootException
Configures whether exceptions should be wrapped to root exceptions during processing.- Parameters:
wrappedToRootException- A boolean indicating whether to enable or disable wrapping to root exceptions.- Returns:
- The Builder instance with the updated wrapped to root exception setting.
-
build
Builds and returns a new instance of YamlMurmel configured with the current state of the Builder instance.- Returns:
- A new YamlMurmel instance configured with the settings defined in the builder.
-