Package net.kyori.adventure.text.format
Interface Style.Builder
- All Superinterfaces:
- Buildable.Builder<Style>
- Enclosing interface:
- Style
public static interface Style.Builder extends Buildable.Builder<Style>
A style builder.
- Since:
- 4.0.0
- 
Method SummaryModifier and Type Method Description default @NonNull Style.Builderapply(@NonNull StyleBuilderApplicable applicable)Appliesapplicableto this builder.@NonNull Stylebuild()Builds the style.@NonNull Style.BuilderclickEvent(@Nullable ClickEvent event)Sets the click event.@NonNull Style.Buildercolor(@Nullable TextColor color)Sets the color.@NonNull Style.BuildercolorIfAbsent(@Nullable TextColor color)Sets the color if there isn't one set already.default @NonNull Style.Builderdecorate(@NonNull TextDecoration decoration)SetsdecorationtoTextDecoration.State.TRUE.default @NonNull Style.Builderdecorate(@NonNull TextDecoration @NonNull ... decorations)SetsdecorationstoTextDecoration.State.TRUE.default @NonNull Style.Builderdecoration(@NonNull TextDecoration decoration, boolean flag)Sets the state of a decoration on this style.@NonNull Style.Builderdecoration(@NonNull TextDecoration decoration, @NonNull TextDecoration.State state)Sets the value of a decoration.@NonNull Style.Builderfont(@Nullable Key font)Sets the font.@NonNull Style.BuilderhoverEvent(@Nullable HoverEventSource<?> source)Sets the hover event.@NonNull Style.Builderinsertion(@Nullable String insertion)Sets the string to be inserted.default @NonNull Style.Buildermerge(@NonNull Style that)Merges from another style into this style.default @NonNull Style.Buildermerge(@NonNull Style that, @NonNull Set<Style.Merge> merges)Merges from another style into this style.default @NonNull Style.Buildermerge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy)Merges from another style into this style.@NonNull Style.Buildermerge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy, @NonNull Set<Style.Merge> merges)Merges from another style into this style.default @NonNull Style.Buildermerge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy, @NonNull Style.Merge @NonNull ... merges)Merges from another style into this style.default @NonNull Style.Buildermerge(@NonNull Style that, @NonNull Style.Merge @NonNull ... merges)Merges from another style into this style.
- 
Method Details- 
fontSets the font.- Parameters:
- font- the font
- Returns:
- this builder
- Since:
- 4.0.0
 
- 
colorSets the color.- Parameters:
- color- the color
- Returns:
- this builder
- Since:
- 4.0.0
 
- 
colorIfAbsentSets the color if there isn't one set already.- Parameters:
- color- the color
- Returns:
- this builder
- Since:
- 4.0.0
 
- 
decorateSetsdecorationtoTextDecoration.State.TRUE.- Parameters:
- decoration- the decoration
- Returns:
- a style
- Since:
- 4.0.0
 
- 
decorateSetsdecorationstoTextDecoration.State.TRUE.- Parameters:
- decorations- the decorations
- Returns:
- a style
- Since:
- 4.0.0
 
- 
decorationSets the state of a decoration on this style.- 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
 
- 
decoration@NonNull Style.Builder decoration(@NonNull TextDecoration decoration, @NonNull TextDecoration.State state)Sets the value of a decoration.- 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
 
- 
clickEventSets the click event.- Parameters:
- event- the click event
- Returns:
- this builder
- Since:
- 4.0.0
 
- 
hoverEventSets the hover event.- Parameters:
- source- the hover event source
- Returns:
- this builder
- Since:
- 4.0.0
 
- 
insertionSets the string to be inserted.- Parameters:
- insertion- the insertion string
- Returns:
- this builder
- Since:
- 4.0.0
 
- 
mergeMerges from another style into this style.- Parameters:
- that- the other style
- Returns:
- a style
- Since:
- 4.0.0
 
- 
mergeMerges from another style into this style.- Parameters:
- that- the other style
- strategy- the merge strategy
- Returns:
- a style
- Since:
- 4.0.0
 
- 
mergedefault @NonNull Style.Builder merge(@NonNull Style that, @NonNull Style.Merge @NonNull ... merges)Merges from another style into this style.- Parameters:
- that- the other style
- merges- the parts to merge
- Returns:
- a style
- Since:
- 4.0.0
 
- 
mergedefault @NonNull Style.Builder merge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy, @NonNull Style.Merge @NonNull ... merges)Merges from another style into this style.- Parameters:
- that- the other style
- strategy- the merge strategy
- merges- the parts to merge
- Returns:
- a style
- Since:
- 4.0.0
 
- 
mergeMerges from another style into this style.- Parameters:
- that- the other style
- merges- the parts to merge
- Returns:
- a style
- Since:
- 4.0.0
 
- 
merge@NonNull Style.Builder merge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy, @NonNull 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:
- a style
- Since:
- 4.0.0
 
- 
applyAppliesapplicableto this builder.- Parameters:
- applicable- the applicable
- Returns:
- this builder
- Since:
- 4.0.0
 
- 
build@NonNull Style build()Builds the style.- Specified by:
- buildin interface- Buildable.Builder<Style>
- Returns:
- the style
 
 
-