Package net.kyori.adventure.text.format
Interface Style.Builder
- 
- All Superinterfaces:
- AbstractBuilder<Style>,- Buildable.Builder<Style>,- MutableStyleSetter<Style.Builder>,- StyleSetter<Style.Builder>
 - Enclosing interface:
- Style
 
 public static interface Style.Builder extends AbstractBuilder<Style>, Buildable.Builder<Style>, MutableStyleSetter<Style.Builder> A style builder.- Since:
- 4.0.0
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default @NotNull Style.Builderapply(@NotNull StyleBuilderApplicable applicable)Appliesapplicableto this builder.@NotNull Stylebuild()Builds the style.@NotNull Style.BuilderclickEvent(@Nullable ClickEvent event)Sets the click event.@NotNull Style.Buildercolor(@Nullable TextColor color)Sets the color.@NotNull Style.BuildercolorIfAbsent(@Nullable TextColor color)Sets the color if there isn't one set already.default @NotNull Style.Builderdecorate(@NotNull TextDecoration decoration)SetsdecorationtoTextDecoration.State.TRUE.default @NotNull Style.Builderdecorate(@NotNull TextDecoration @NotNull ... decorations)SetsdecorationstoTextDecoration.State.TRUE.default @NotNull Style.Builderdecoration(@NotNull TextDecoration decoration, boolean flag)Sets the state of a decoration on this style.@NotNull Style.Builderdecoration(@NotNull TextDecoration decoration, @NotNull TextDecoration.State state)Sets the value of a decoration.default @NotNull Style.Builderdecorations(@NotNull Map<TextDecoration,TextDecoration.State> decorations)Sets decorations for this style using the specifieddecorationsmap.@NotNull Style.Builderfont(@Nullable Key font)Sets the font.@NotNull Style.BuilderhoverEvent(@Nullable HoverEventSource<?> source)Sets the hover event.@NotNull Style.Builderinsertion(@Nullable String insertion)Sets the string to be inserted.default @NotNull Style.Buildermerge(@NotNull Style that)Merges from another style into this style.default @NotNull Style.Buildermerge(@NotNull Style that, @NotNull Set<Style.Merge> merges)Merges from another style into this style.default @NotNull Style.Buildermerge(@NotNull Style that, @NotNull Style.Merge.Strategy strategy)Merges from another style into this style.@NotNull Style.Buildermerge(@NotNull Style that, @NotNull Style.Merge.Strategy strategy, @NotNull Set<Style.Merge> merges)Merges from another style into this style.default @NotNull Style.Buildermerge(@NotNull Style that, @NotNull Style.Merge.Strategy strategy, @NotNull Style.Merge @NotNull ... merges)Merges from another style into this style.default @NotNull Style.Buildermerge(@NotNull Style that, @NotNull Style.Merge @NotNull ... merges)Merges from another style into this style.- 
Methods inherited from interface net.kyori.adventure.text.format.MutableStyleSetterdecorations
 
- 
 
- 
- 
- 
Method Detail- 
font@Contract("_ -> this") @NotNull @NotNull Style.Builder font(@Nullable @Nullable Key font)Sets the font.- Specified by:
- fontin interface- StyleSetter<Style.Builder>
- Parameters:
- font- the font
- Returns:
- this builder
- Since:
- 4.0.0
- Since Minecraft:
- 1.16
 
 - 
color@Contract("_ -> this") @NotNull @NotNull Style.Builder color(@Nullable @Nullable TextColor color)Sets the color.- Specified by:
- colorin interface- StyleSetter<Style.Builder>
- Parameters:
- color- the color
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
colorIfAbsent@Contract("_ -> this") @NotNull @NotNull Style.Builder colorIfAbsent(@Nullable @Nullable TextColor color)Sets the color if there isn't one set already.- Specified by:
- colorIfAbsentin interface- StyleSetter<Style.Builder>
- Parameters:
- color- the color
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
decorate@Contract("_ -> this") @NotNull default @NotNull Style.Builder decorate(@NotNull @NotNull TextDecoration decoration)SetsdecorationtoTextDecoration.State.TRUE.- Specified by:
- decoratein interface- StyleSetter<Style.Builder>
- Parameters:
- decoration- the decoration
- Returns:
- a style
- Since:
- 4.0.0
 
 - 
decorate@Contract("_ -> this") @NotNull default @NotNull Style.Builder decorate(@NotNull @NotNull TextDecoration @NotNull ... decorations)SetsdecorationstoTextDecoration.State.TRUE.- Specified by:
- decoratein interface- MutableStyleSetter<Style.Builder>
- Specified by:
- decoratein interface- StyleSetter<Style.Builder>
- Parameters:
- decorations- the decorations
- Returns:
- a style
- Since:
- 4.0.0
 
 - 
decoration@Contract("_, _ -> this") @NotNull default @NotNull Style.Builder decoration(@NotNull @NotNull TextDecoration decoration, boolean flag)Sets the state of a decoration on this style.- Specified by:
- decorationin interface- StyleSetter<Style.Builder>
- Parameters:
- decoration- the decoration
- flag-- trueif this style should have the decoration,- falseif this style should not have the decoration
- Returns:
- a style
- Since:
- 4.0.0
 
 - 
decorations@Contract("_ -> this") @NotNull default @NotNull Style.Builder decorations(@NotNull @NotNull Map<TextDecoration,TextDecoration.State> decorations)Sets decorations for this style using the specifieddecorationsmap.If a given decoration does not have a value explicitly set, the value of that particular decoration is not changed. - Specified by:
- decorationsin interface- MutableStyleSetter<Style.Builder>
- Specified by:
- decorationsin interface- StyleSetter<Style.Builder>
- Parameters:
- decorations- a map containing text decorations and their respective state.
- Returns:
- this builder.
- Since:
- 4.10.0
 
 - 
decoration@Contract("_, _ -> this") @NotNull @NotNull Style.Builder decoration(@NotNull @NotNull TextDecoration decoration, @NotNull TextDecoration.State state)Sets the value of a decoration.- Specified by:
- decorationin interface- StyleSetter<Style.Builder>
- Parameters:
- decoration- the decoration
- state-- TextDecoration.State.TRUEif this component should have the decoration,- TextDecoration.State.FALSEif this component should not have the decoration, and- TextDecoration.State.NOT_SETif the decoration should not have a set value
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
clickEvent@Contract("_ -> this") @NotNull @NotNull Style.Builder clickEvent(@Nullable @Nullable ClickEvent event)Sets the click event.- Specified by:
- clickEventin interface- StyleSetter<Style.Builder>
- Parameters:
- event- the click event
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
hoverEvent@Contract("_ -> this") @NotNull @NotNull Style.Builder hoverEvent(@Nullable @Nullable HoverEventSource<?> source)Sets the hover event.- Specified by:
- hoverEventin interface- StyleSetter<Style.Builder>
- Parameters:
- source- the hover event source
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
insertion@Contract("_ -> this") @NotNull @NotNull Style.Builder insertion(@Nullable @Nullable String insertion)Sets the string to be inserted.- Specified by:
- insertionin interface- StyleSetter<Style.Builder>
- Parameters:
- insertion- the insertion string
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
merge@Contract("_ -> this") @NotNull default @NotNull Style.Builder merge(@NotNull @NotNull Style that)Merges from another style into this style.- Parameters:
- that- the other style
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
merge@Contract("_, _ -> this") @NotNull default @NotNull Style.Builder merge(@NotNull @NotNull Style that, @NotNull Style.Merge.Strategy strategy)Merges from another style into this style.- Parameters:
- that- the other style
- strategy- the merge strategy
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
merge@Contract("_, _ -> this") @NotNull default @NotNull Style.Builder merge(@NotNull @NotNull Style that, @NotNull @NotNull Style.Merge @NotNull ... merges)Merges from another style into this style.- Parameters:
- that- the other style
- merges- the parts to merge
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
merge@Contract("_, _, _ -> this") @NotNull default @NotNull Style.Builder merge(@NotNull @NotNull Style that, @NotNull Style.Merge.Strategy strategy, @NotNull @NotNull Style.Merge @NotNull ... merges)Merges from another style into this style.- Parameters:
- that- the other style
- strategy- the merge strategy
- merges- the parts to merge
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
merge@Contract("_, _ -> this") @NotNull default @NotNull Style.Builder merge(@NotNull @NotNull Style that, @NotNull @NotNull Set<Style.Merge> merges)Merges from another style into this style.- Parameters:
- that- the other style
- merges- the parts to merge
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
merge@Contract("_, _, _ -> this") @NotNull @NotNull Style.Builder merge(@NotNull @NotNull Style that, @NotNull Style.Merge.Strategy strategy, @NotNull @NotNull Set<Style.Merge> merges)Merges from another style into this style.- Parameters:
- that- the other style
- strategy- the merge strategy
- merges- the parts to merge
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
apply@Contract("_ -> this") @NotNull default @NotNull Style.Builder apply(@NotNull @NotNull StyleBuilderApplicable applicable)Appliesapplicableto this builder.- Parameters:
- applicable- the applicable
- Returns:
- this builder
- Since:
- 4.0.0
 
 - 
build@NotNull @NotNull Style build() Builds the style.- Specified by:
- buildin interface- AbstractBuilder<Style>
- Specified by:
- buildin interface- Buildable.Builder<Style>
- Returns:
- the style
 
 
- 
 
-