Package net.kyori.adventure.text.format
Interface MutableStyleSetter<T extends MutableStyleSetter<?>>
- Type Parameters:
T
- The type implementing this interface e.g.Component
- All Superinterfaces:
StyleSetter<T>
- All Known Subinterfaces:
BlockNBTComponent.Builder
,ComponentBuilder<C,
,B> EntityNBTComponent.Builder
,KeybindComponent.Builder
,NBTComponentBuilder<C,
,B> ScoreComponent.Builder
,SelectorComponent.Builder
,StorageNBTComponent.Builder
,Style.Builder
,TextComponent.Builder
,TranslatableComponent.Builder
@NonExtendable
public interface MutableStyleSetter<T extends MutableStyleSetter<?>>
extends StyleSetter<T>
Writes style properties to a mutable object. Used to override some default methods from
StyleSetter
with faster alternatives that only work for mutable objects.- Since:
- 4.10.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault T
decorate
(@NotNull TextDecoration @NotNull ... decorations) Setsdecorations
toTextDecoration.State.TRUE
.default T
decorations
(@NotNull Map<TextDecoration, TextDecoration.State> decorations) Sets decorations using the specifieddecorations
map.default T
decorations
(@NotNull Set<TextDecoration> decorations, boolean flag) Sets the state of a set of decorations toflag
.Methods inherited from interface net.kyori.adventure.text.format.StyleSetter
clickEvent, color, colorIfAbsent, decorate, decoration, decoration, decorationIfAbsent, font, hoverEvent, insertion, shadowColor, shadowColorIfAbsent
-
Method Details
-
decorate
@Contract("_ -> this") @NotNull default T decorate(@NotNull @NotNull TextDecoration @NotNull ... decorations) Setsdecorations
toTextDecoration.State.TRUE
.- Specified by:
decorate
in interfaceStyleSetter<T extends MutableStyleSetter<?>>
- Parameters:
decorations
- the decorations- Returns:
- a mutable object (
T
) - Since:
- 4.10.0
-
decorations
@Contract("_ -> this") @NotNull default T decorations(@NotNull @NotNull Map<TextDecoration, TextDecoration.State> decorations) Sets decorations using the specifieddecorations
map.If a given decoration does not have a value explicitly set, the value of that particular decoration is not changed.
- Specified by:
decorations
in interfaceStyleSetter<T extends MutableStyleSetter<?>>
- Parameters:
decorations
- a map containing text decorations and their respective state.- Returns:
- a mutable object (
T
) - Since:
- 4.10.0
-
decorations
@Contract("_, _ -> this") @NotNull default T decorations(@NotNull @NotNull Set<TextDecoration> decorations, boolean flag) Sets the state of a set of decorations toflag
.- Specified by:
decorations
in interfaceStyleSetter<T extends MutableStyleSetter<?>>
- Parameters:
decorations
- the decorationsflag
-true
if this mutable object should have the decorations,false
if this mutable object should not have the decorations- Returns:
- a mutable object (
T
) - Since:
- 4.10.0
-