Interface ConfigurateComponentSerializer.Builder

Enclosing interface:
ConfigurateComponentSerializer

public static interface ConfigurateComponentSerializer.Builder
A builder for a configurate serializer instance.
Since:
4.0.0
  • Method Details

    • scalarSerializer

      @NonNull ConfigurateComponentSerializer.Builder scalarSerializer​(@NonNull net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.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.0.0
    • outputStringComponents

      @NonNull ConfigurateComponentSerializer.Builder outputStringComponents​(boolean stringComponents)
      If the scalarSerializer(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

      Create a new component serializer instance.
      Returns:
      new serializer
      Since:
      4.0.0