Interface ANSIComponentSerializer.Builder
-
- All Superinterfaces:
AbstractBuilder<ANSIComponentSerializer>
- Enclosing interface:
- ANSIComponentSerializer
public static interface ANSIComponentSerializer.Builder extends AbstractBuilder<ANSIComponentSerializer>
A builder for the ANSI component serializer.- Since:
- 4.14.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull ANSIComponentSerializer
build()
Builds the serializer.@NotNull ANSIComponentSerializer.Builder
colorLevel(@NotNull net.kyori.ansi.ColorLevel colorLevel)
Sets the default color level used when serializing.@NotNull ANSIComponentSerializer.Builder
flattener(@NotNull ComponentFlattener componentFlattener)
Sets the component flattener instance to use when traversing the component for serialization.
-
-
-
Method Detail
-
colorLevel
@NotNull @NotNull ANSIComponentSerializer.Builder colorLevel(@NotNull @NotNull net.kyori.ansi.ColorLevel colorLevel)
Sets the default color level used when serializing.By default, this serializer will use
ColorLevel.compute()
to try to detect the color level of the terminal being used.- Parameters:
colorLevel
- the color level- Returns:
- this builder
- Since:
- 4.14.0
- See Also:
ColorLevel
-
flattener
@NotNull @NotNull ANSIComponentSerializer.Builder flattener(@NotNull @NotNull ComponentFlattener componentFlattener)
Sets the component flattener instance to use when traversing the component for serialization.By default, this serializer will use
ComponentFlattener.basic()
.- Parameters:
componentFlattener
- the flattener instance.- Returns:
- this builder
- Since:
- 4.14.0
-
build
@NotNull @NotNull ANSIComponentSerializer build()
Builds the serializer.- Specified by:
build
in interfaceAbstractBuilder<ANSIComponentSerializer>
- Returns:
- the built serializer
-
-