com.fasterxml.jackson.core.util

## Class Separators

- java.lang.Object
- - com.fasterxml.jackson.core.util.Separators

All Implemented Interfaces:
  Serializable

    public class Separators
    extends Object
    implements Serializable

Value class used with some `PrettyPrinter` implements

Since:
  2.9
See Also:
  `DefaultPrettyPrinter`, `MinimalPrettyPrinter`, Serialized Form

### Nested Class Summary

Nested Classes
`static class` `Separators.Spacing` Define the spacing around elements like commas and colons.

### Field Summary

Fields
`static String` `DEFAULT_ARRAY_EMPTY_SEPARATOR` String to use in empty Array to separate start and end markers.
`static String` `DEFAULT_OBJECT_EMPTY_SEPARATOR` String to use in empty Object to separate start and end markers.
`static String` `DEFAULT_ROOT_VALUE_SEPARATOR` Constant that specifies default "root-level" separator to use between root values: a single space character.

### Constructor Summary

Constructors
Constructor and Description
`Separators()` Constructor for creating an instance with default settings for all separators.
`Separators(char objectFieldValueSeparator, char objectEntrySeparator, char arrayValueSeparator)` Create an instance with the specified separator characters.
`Separators(String rootSeparator, char objectFieldValueSeparator, Separators.Spacing objectFieldValueSpacing, char objectEntrySeparator, Separators.Spacing objectEntrySpacing, char arrayValueSeparator, Separators.Spacing arrayValueSpacing)` Deprecated. Since 2.17 use new canonical constructor

`Separators(String rootSeparator, char objectFieldValueSeparator, Separators.Spacing objectFieldValueSpacing, char objectEntrySeparator, Separators.Spacing objectEntrySpacing, String objectEmptySeparator, char arrayValueSeparator, Separators.Spacing arrayValueSpacing, String arrayEmptySeparator)`
Canonical constructor for creating an instance with the specified separator characters and spaces around those characters.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static Separators` `createDefaultInstance()`
`String` `getArrayEmptySeparator()`
`char` `getArrayValueSeparator()`
`Separators.Spacing` `getArrayValueSpacing()`
`String` `getObjectEmptySeparator()`
`char` `getObjectEntrySeparator()`
`Separators.Spacing` `getObjectEntrySpacing()`
`char` `getObjectFieldValueSeparator()`
`Separators.Spacing` `getObjectFieldValueSpacing()`
`String` `getRootSeparator()`
`Separators` `withArrayEmptySeparator(String sep)`
`Separators` `withArrayValueSeparator(char sep)`
`Separators` `withArrayValueSpacing(Separators.Spacing spacing)`
`Separators` `withObjectEmptySeparator(String sep)`
`Separators` `withObjectEntrySeparator(char sep)`
`Separators` `withObjectEntrySpacing(Separators.Spacing spacing)`
`Separators` `withObjectFieldValueSeparator(char sep)`
`Separators` `withObjectFieldValueSpacing(Separators.Spacing spacing)`
`Separators` `withRootSeparator(String sep)`

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

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

### Field Detail

#### DEFAULT_ROOT_VALUE_SEPARATOR

    public static final String DEFAULT_ROOT_VALUE_SEPARATOR

Constant that specifies default "root-level" separator to use between root values: a single space character.

Since:
  2.16
See Also:
  Constant Field Values

#### DEFAULT_OBJECT_EMPTY_SEPARATOR

    public static final String DEFAULT_OBJECT_EMPTY_SEPARATOR

String to use in empty Object to separate start and end markers. Default is single space, resulting in output of `{ }`.

Since:
  2.17
See Also:
  Constant Field Values

#### DEFAULT_ARRAY_EMPTY_SEPARATOR

    public static final String DEFAULT_ARRAY_EMPTY_SEPARATOR

String to use in empty Array to separate start and end markers. Default is single space, resulting in output of `[ ]`.

Since:
  2.17
See Also:
  Constant Field Values

### Constructor Detail

#### Separators

    public Separators()

Constructor for creating an instance with default settings for all separators.

#### Separators

    public Separators(char objectFieldValueSeparator,
                      char objectEntrySeparator,
                      char arrayValueSeparator)

Create an instance with the specified separator characters. There will be spaces before and after the `objectFieldValueSeparator` and none around the other two.

#### Separators

    @Deprecated
    public Separators(String rootSeparator,
                                  char objectFieldValueSeparator,
                                  Separators.Spacing objectFieldValueSpacing,
                                  char objectEntrySeparator,
                                  Separators.Spacing objectEntrySpacing,
                                  char arrayValueSeparator,
                                  Separators.Spacing arrayValueSpacing)

Deprecated. Since 2.17 use new canonical constructor
Create an instance with the specified separator characters and spaces around those characters.

Since:
  2.16

#### Separators

    public Separators(String rootSeparator,
                      char objectFieldValueSeparator,
                      Separators.Spacing objectFieldValueSpacing,
                      char objectEntrySeparator,
                      Separators.Spacing objectEntrySpacing,
                      String objectEmptySeparator,
                      char arrayValueSeparator,
                      Separators.Spacing arrayValueSpacing,
                      String arrayEmptySeparator)

Canonical constructor for creating an instance with the specified separator characters and spaces around those characters.

Since:
  2.17

### Method Detail

#### createDefaultInstance

    public static Separators createDefaultInstance()

#### withRootSeparator

    public Separators withRootSeparator(String sep)

#### withObjectFieldValueSeparator

    public Separators withObjectFieldValueSeparator(char sep)

#### withObjectFieldValueSpacing

    public Separators withObjectFieldValueSpacing(Separators.Spacing spacing)

Returns:
  This instance (for call chaining)
Since:
  2.16

#### withObjectEntrySeparator

    public Separators withObjectEntrySeparator(char sep)

#### withObjectEntrySpacing

    public Separators withObjectEntrySpacing(Separators.Spacing spacing)

Returns:
  This instance (for call chaining)
Since:
  2.16

#### withObjectEmptySeparator

    public Separators withObjectEmptySeparator(String sep)

Returns:
  This instance (for call chaining)
Since:
  2.17

#### withArrayValueSeparator

    public Separators withArrayValueSeparator(char sep)

#### withArrayValueSpacing

    public Separators withArrayValueSpacing(Separators.Spacing spacing)

Returns:
  This instance (for call chaining)
Since:
  2.16

#### withArrayEmptySeparator

    public Separators withArrayEmptySeparator(String sep)

Returns:
  This instance (for call chaining)
Since:
  2.17

#### getRootSeparator

    public String getRootSeparator()

Returns:
  String used as Root value separator
Since:
  2.16

#### getObjectFieldValueSeparator

    public char getObjectFieldValueSeparator()

#### getObjectFieldValueSpacing

    public Separators.Spacing getObjectFieldValueSpacing()

Returns:
  `Separators.Spacing` to use for Object fields
Since:
  2.16

#### getObjectEntrySeparator

    public char getObjectEntrySeparator()

#### getObjectEntrySpacing

    public Separators.Spacing getObjectEntrySpacing()

Returns:
  `Separators.Spacing` to use for Object entries
Since:
  2.16

#### getObjectEmptySeparator

    public String getObjectEmptySeparator()

Returns:
  String to use in empty Object
Since:
  2.17

#### getArrayValueSeparator

    public char getArrayValueSeparator()

#### getArrayValueSpacing

    public Separators.Spacing getArrayValueSpacing()

Returns:
  `Separators.Spacing` to use between Array values
Since:
  2.16

#### getArrayEmptySeparator

    public String getArrayEmptySeparator()

Returns:
  String to use in empty Array
Since:
  2.17