com.typesafe.config

## Class ConfigRenderOptions

- java.lang.Object
- - com.typesafe.config.ConfigRenderOptions

    public final class ConfigRenderOptions
    extends Object

A set of options related to rendering a `ConfigValue`. Passed to `ConfigValue.render(ConfigRenderOptions)`.

Here is an example of creating a `ConfigRenderOptions`:

         ConfigRenderOptions options =
             ConfigRenderOptions.defaults().setComments(false)

### Method Summary

Methods
`static ConfigRenderOptions` `concise()` Returns concise render options (no whitespace or comments).
`static ConfigRenderOptions` `defaults()` Returns the default render options which are verbose (commented and formatted).
`boolean` `getComments()` Returns whether the options enable comments.
`boolean` `getFormatted()` Returns whether the options enable formatting.
`boolean` `getOriginComments()` Returns whether the options enable automated origin comments.
`ConfigRenderOptions` `setComments(boolean value)` Returns options with comments toggled.
`ConfigRenderOptions` `setFormatted(boolean value)` Returns options with formatting toggled.
`ConfigRenderOptions` `setOriginComments(boolean value)` Returns options with origin comments toggled.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### defaults

    public static ConfigRenderOptions defaults()

Returns the default render options which are verbose (commented and formatted). See `concise()` for stripped-down options. This rendering will not be valid JSON since it has comments.

Returns:
  the default render options

#### concise

    public static ConfigRenderOptions concise()

Returns concise render options (no whitespace or comments). For a resolved `Config`, the concise rendering will be valid JSON.

Returns:
  the concise render options

#### setComments

    public ConfigRenderOptions setComments(boolean value)

Returns options with comments toggled. This controls human-written comments but not the autogenerated "origin of this setting" comments, which are controlled by `setOriginComments(boolean)`.

Parameters:
  `value` - true to include comments in the render
Returns:
  options with requested setting for comments

#### getComments

    public boolean getComments()

Returns whether the options enable comments. This method is mostly used by the config lib internally, not by applications.

Returns:
  true if comments should be rendered

#### setOriginComments

    public ConfigRenderOptions setOriginComments(boolean value)

Returns options with origin comments toggled. If this is enabled, the library generates comments for each setting based on the `ConfigValue.origin()` of that setting's value. For example these comments might tell you which file a setting comes from.

`setOriginComments()` controls only these autogenerated "origin of this setting" comments, to toggle regular comments use `setComments(boolean)`.

Parameters:
  `value` - true to include autogenerated setting-origin comments in the render
Returns:
  options with origin comments toggled

#### getOriginComments

    public boolean getOriginComments()

Returns whether the options enable automated origin comments. This method is mostly used by the config lib internally, not by applications.

Returns:
  true if origin comments should be rendered

#### setFormatted

    public ConfigRenderOptions setFormatted(boolean value)

Returns options with formatting toggled. Formatting means indentation and whitespace, enabling formatting makes things prettier but larger.

Parameters:
  `value` - true to include comments in the render
Returns:
  options with requested setting for formatting

#### getFormatted

    public boolean getFormatted()

Returns whether the options enable formatting. This method is mostly used by the config lib internally, not by applications.

Returns:
  true if comments should be rendered