Class YamlConfigurationOptions.QuoteStyleDefaults
java.lang.Object
org.simpleyaml.configuration.file.YamlConfigurationOptions.QuoteStyleDefaults
- Enclosing class:
- YamlConfigurationOptions
Options to configure the default
QuoteStyle for each type.-
Method Summary
Modifier and TypeMethodDescriptionGet the default quote style.getQuoteStyle(Class<?> valueClass) Get the quote style to apply to a specific type.Map<Class<?>,QuoteStyle> Get the overriden quote styles for every specific type set.setDefaultQuoteStyle(QuoteStyle defaultQuoteStyle) Set the default quote style.setQuoteStyle(Class<?> valueClass, QuoteStyle quoteStyle) Set the default quote style for a specific type.
-
Method Details
-
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 stylequoteStyle- the quote style to apply- Returns:
- This object, for chaining
-
getQuoteStyle
Get the quote style to apply to a specific type. If it was not explicitly set using thesetQuoteStyle(Class, QuoteStyle)method then thegetDefaultQuoteStyle()is returned.- Parameters:
valueClass- the type class- Returns:
- the quote style to apply to the specified class
-
getQuoteStyles
Get the overriden quote styles for every specific type set.- Returns:
- the quote styles to apply to every specified class
-