Interface ConfigurateComponentSerializer.Builder
-
- Enclosing interface:
- ConfigurateComponentSerializer
public static interface ConfigurateComponentSerializer.Builder
A builder for a configurate serializer instance.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull ConfigurateComponentSerializer
build()
Create a new component serializer instance.@NotNull ConfigurateComponentSerializer.Builder
outputStringComponents(boolean stringComponents)
If thescalarSerializer(ComponentSerializer)
is set, output components as serialized strings rather than following an object structure.@NotNull ConfigurateComponentSerializer.Builder
scalarSerializer(@NotNull ComponentSerializer<Component,?,java.lang.String> stringSerializer)
Set the serializer to use when reading Components.
-
-
-
Method Detail
-
scalarSerializer
@NotNull @NotNull ConfigurateComponentSerializer.Builder scalarSerializer(@NotNull @NotNull ComponentSerializer<Component,?,java.lang.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.0.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.0.0
-
build
@NotNull @NotNull ConfigurateComponentSerializer build()
Create a new component serializer instance.- Returns:
- new serializer
- Since:
- 4.0.0
-
-