Class YamlConfigurationOptions.QuoteStyleDefaults

java.lang.Object
org.simpleyaml.configuration.file.YamlConfigurationOptions.QuoteStyleDefaults
Enclosing class:
YamlConfigurationOptions

public static final class YamlConfigurationOptions.QuoteStyleDefaults extends Object
Options to configure the default QuoteStyle for each type.
  • Method Details

    • getDefaultQuoteStyle

      public QuoteStyle getDefaultQuoteStyle()
      Get the default quote style. This style is applied to all values.
      Returns:
      the default quote style
    • setDefaultQuoteStyle

      public YamlConfigurationOptions.QuoteStyleDefaults setDefaultQuoteStyle(QuoteStyle defaultQuoteStyle)
      Set the default quote style. This style is applied to all values.
      Returns:
      This object, for chaining
    • setQuoteStyle

      public YamlConfigurationOptions.QuoteStyleDefaults setQuoteStyle(Class<?> valueClass, QuoteStyle quoteStyle)
      Set the default quote style for a specific type.

      This style is applied to values which class is the specified class or is a child of that class.

      Example:

       options.setQuoteStyle(String.class, QuoteStyle.DOUBLE);
       yamlConfig.set("key", "This string will be set with double quote style");
       

      Set quoteStyle to null to set new values again with the default quote style.

      Parameters:
      valueClass - the specific class to override default quote style
      quoteStyle - the quote style to apply
      Returns:
      This object, for chaining
    • getQuoteStyle

      public QuoteStyle getQuoteStyle(Class<?> valueClass)
      Get the quote style to apply to a specific type.

      If it was not explicitly set using the setQuoteStyle(Class, QuoteStyle) method then the getDefaultQuoteStyle() is returned.

      Parameters:
      valueClass - the type class
      Returns:
      the quote style to apply to the specified class
    • getQuoteStyles

      public Map<Class<?>,QuoteStyle> getQuoteStyles()
      Get the overriden quote styles for every specific type set.
      Returns:
      the quote styles to apply to every specified class