Interface GsonComponentSerializer.Builder
-
- All Superinterfaces:
AbstractBuilder<GsonComponentSerializer>
,Buildable.Builder<GsonComponentSerializer>
- Enclosing interface:
- GsonComponentSerializer
public static interface GsonComponentSerializer.Builder extends AbstractBuilder<GsonComponentSerializer>, Buildable.Builder<GsonComponentSerializer>
A builder forGsonComponentSerializer
.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull GsonComponentSerializer
build()
Builds the serializer.@NotNull GsonComponentSerializer.Builder
downsampleColors()
Sets that the serializer should downsample hex colors to named colors.@NotNull GsonComponentSerializer.Builder
emitLegacyHoverEvent()
Output a legacy hover eventvalue
in addition to the moderncontents
.@NotNull GsonComponentSerializer.Builder
legacyHoverEventSerializer(@Nullable LegacyHoverEventSerializer serializer)
Sets a serializer that will be used to interpret legacy hover eventvalue
payloads.
-
-
-
Method Detail
-
downsampleColors
@NotNull @NotNull GsonComponentSerializer.Builder downsampleColors()
Sets that the serializer should downsample hex colors to named colors.- Returns:
- this builder
- Since:
- 4.0.0
-
legacyHoverEventSerializer
@NotNull @NotNull GsonComponentSerializer.Builder legacyHoverEventSerializer(@Nullable @Nullable LegacyHoverEventSerializer serializer)
Sets a serializer that will be used to interpret legacy hover eventvalue
payloads. If the serializer isnull
, then onlyHoverEvent.Action.SHOW_TEXT
legacy hover events can be deserialized.- Parameters:
serializer
- serializer- Returns:
- this builder
- Since:
- 4.0.0
-
emitLegacyHoverEvent
@NotNull @NotNull GsonComponentSerializer.Builder emitLegacyHoverEvent()
Output a legacy hover eventvalue
in addition to the moderncontents
.A
legacy hover serializer
must also be set to serialize any hover events beyond those with actionHoverEvent.Action.SHOW_TEXT
- Returns:
- this builder
- Since:
- 4.0.0
-
build
@NotNull @NotNull GsonComponentSerializer build()
Builds the serializer.- Specified by:
build
in interfaceAbstractBuilder<GsonComponentSerializer>
- Specified by:
build
in interfaceBuildable.Builder<GsonComponentSerializer>
- Returns:
- the built serializer
-
-