Interface ConfigurateComponentSerializer.Builder
- Enclosing interface:
- ConfigurateComponentSerializer
public static interface ConfigurateComponentSerializer.Builder
A builder for a configurate serializer instance.
- Since:
- 4.2.0
-
Method Summary
Modifier and TypeMethodDescription@NotNull ConfigurateComponentSerializer
build()
Create a new component serializer instance.outputStringComponents
(boolean stringComponents) If thescalarSerializer(ComponentSerializer)
is set, output components as serialized strings rather than following an object structure.scalarSerializer
(@NotNull ComponentSerializer<Component, ?, String> stringSerializer) Set the serializer to use when reading Components.
-
Method Details
-
scalarSerializer
@NotNull @NotNull ConfigurateComponentSerializer.Builder scalarSerializer(@NotNull @NotNull ComponentSerializer<Component, ?, String> stringSerializer) Set the serializer to use when reading Components.While the created serializer will always be able to read and write Components in their object structure, for configuration purposes it is often easier to work with Components as Strings using one of a variety of available representations.
- Parameters:
stringSerializer
- string serializer to use- Returns:
- this builder
- Since:
- 4.2.0
-
outputStringComponents
@NotNull @NotNull ConfigurateComponentSerializer.Builder outputStringComponents(boolean stringComponents) If thescalarSerializer(ComponentSerializer)
is set, output components as serialized strings rather than following an object structure.By default, Components are serialized in object form, and deserialized in either format based on the configured
scalarSerializer(ComponentSerializer)
.- Parameters:
stringComponents
- Whether to output as strings- Returns:
- this builder
- Since:
- 4.2.0
-
build
Create a new component serializer instance.- Returns:
- new serializer
- Since:
- 4.2.0
-