Interface JSONComponentSerializer.Builder
- All Known Subinterfaces:
GsonComponentSerializer.Builder
- Enclosing interface:
JSONComponentSerializer
public static interface JSONComponentSerializer.Builder
A builder for
JSONComponentSerializer instances that delegates to the active serializer.- Since:
- 4.14.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Create a finished serializer instance.editOptions(Consumer<net.kyori.option.OptionState.Builder> optionEditor) Edit the active set of serializer options.legacyHoverEventSerializer(@Nullable LegacyHoverEventSerializer serializer) Sets a serializer that will be used to interpret legacy hover eventvaluepayloads.options(net.kyori.option.OptionState flags) Set the option state to apply on this serializer.
-
Method Details
-
options
Set the option state to apply on this serializer.This controls how the serializer emits and interprets components.
- Parameters:
flags- the flag set to use- Returns:
- this builder
- Since:
- 4.15.0
- See Also:
-
editOptions
JSONComponentSerializer.Builder editOptions(Consumer<net.kyori.option.OptionState.Builder> optionEditor) Edit the active set of serializer options.- Parameters:
optionEditor- the consumer operating on the existing flag set- Returns:
- this builder
- Since:
- 4.15.0
- See Also:
-
legacyHoverEventSerializer
JSONComponentSerializer.Builder legacyHoverEventSerializer(@Nullable LegacyHoverEventSerializer serializer) Sets a serializer that will be used to interpret legacy hover eventvaluepayloads. If the serializer isnull, then onlyHoverEvent.Action.SHOW_TEXTlegacy hover events can be deserialized.- Parameters:
serializer- serializer- Returns:
- this builder
- Since:
- 4.14.0
-
build
JSONComponentSerializer build()Create a finished serializer instance.- Returns:
- the new serializer
- Since:
- 4.14.0
-