public interface Component
| Modifier and Type | Method and Description |
|---|---|
@NonNull Component |
append(@NonNull Component component)
Appends a component to this component.
|
default @NonNull Component |
append(@NonNull ComponentBuilder<?,?> builder)
Appends a component to this component.
|
@NonNull java.util.List<Component> |
children()
Gets the unmodifiable list of children.
|
@NonNull Component |
children(@NonNull java.util.List<Component> children)
Sets the list of children.
|
default @Nullable ClickEvent |
clickEvent()
Gets the click event of this component.
|
default @NonNull Component |
clickEvent(@Nullable ClickEvent event)
Sets the click event of this component.
|
default @Nullable TextColor |
color()
Gets the color of this component.
|
default @NonNull Component |
color(@Nullable TextColor color)
Sets the color of this component.
|
default boolean |
contains(@NonNull Component that)
Checks if this component contains a component.
|
default TextDecoration.State |
decoration(@NonNull TextDecoration decoration)
Gets the state of a decoration on this component.
|
default @NonNull Component |
decoration(@NonNull TextDecoration decoration,
boolean flag)
Sets the state of a decoration on this component.
|
default @NonNull Component |
decoration(@NonNull TextDecoration decoration,
TextDecoration.State state)
Sets the value of a decoration on this component.
|
default @NonNull java.util.Set<TextDecoration> |
decorations()
Gets a set of decorations this component has.
|
default @NonNull java.util.Set<TextDecoration> |
decorations(@NonNull java.util.Set<TextDecoration> defaultValues)
Gets a set of decorations this component has.
|
default void |
detectCycle(@NonNull Component that)
Prevents a cycle between this component and the provided component.
|
default boolean |
hasDecoration(@NonNull TextDecoration decoration)
Tests if this component has a decoration.
|
default boolean |
hasStyling()
Tests if this component has any styling.
|
default @Nullable HoverEvent |
hoverEvent()
Gets the hover event of this component.
|
default @NonNull Component |
hoverEvent(@Nullable HoverEvent event)
Sets the hover event of this component.
|
default @Nullable java.lang.String |
insertion()
Gets the string to be inserted when this component is shift-clicked.
|
default @NonNull Component |
insertion(@Nullable java.lang.String insertion)
Sets the string to be inserted when this component is shift-clicked.
|
default @NonNull Component |
mergeColor(@NonNull Component that)
Merges the color from another component into this component.
|
default @NonNull Component |
mergeDecorations(@NonNull Component that)
Merges the decorations from another component into this component.
|
default @NonNull Component |
mergeEvents(@NonNull Component that)
Merges the events from another component into this component.
|
@NonNull Style |
style()
Gets the style of this component.
|
@NonNull Component |
style(@NonNull Style style)
Sets the style of this component.
|
@NonNull java.util.List<Component> children()
@NonNull Component children(@NonNull java.util.List<Component> children)
The contents of children will be copied.
children - the childrendefault boolean contains(@NonNull Component that)
that - the other componenttrue if this component contains the provided
component, false otherwisedefault void detectCycle(@NonNull Component that)
that - the other component@NonNull Component append(@NonNull Component component)
component - the component to appenddefault @NonNull Component append(@NonNull ComponentBuilder<?,?> builder)
builder - the component to append@NonNull Style style()
@NonNull Component style(@NonNull Style style)
style - the styledefault @Nullable TextColor color()
default @NonNull Component color(@Nullable TextColor color)
color - the colordefault boolean hasDecoration(@NonNull TextDecoration decoration)
decoration - the decorationtrue if this component has the decoration, false if this
component does not have the decorationdefault TextDecoration.State decoration(@NonNull TextDecoration decoration)
decoration - the decorationTextDecoration.State#TRUE if this component has the decoration,
TextDecoration.State#FALSE if this component does not have the decoration,
and TextDecoration.State#NOT_SET if not setdefault @NonNull Component decoration(@NonNull TextDecoration decoration, boolean flag)
decoration - the decorationflag - true if this component should have the decoration, false if
this component should not have the decorationdefault @NonNull Component decoration(@NonNull TextDecoration decoration, TextDecoration.State state)
decoration - the decorationstate - TextDecoration.State#TRUE if this component should have the
decoration, TextDecoration.State#FALSE if this component should not
have the decoration, and TextDecoration.State#NOT_SET if the decoration
should not have a set valuedefault @NonNull java.util.Set<TextDecoration> decorations()
default @NonNull java.util.Set<TextDecoration> decorations(@NonNull java.util.Set<TextDecoration> defaultValues)
defaultValues - a set of default valuesdefault @Nullable ClickEvent clickEvent()
default @NonNull Component clickEvent(@Nullable ClickEvent event)
event - the click eventdefault @Nullable HoverEvent hoverEvent()
default @NonNull Component hoverEvent(@Nullable HoverEvent event)
event - the hover eventdefault @Nullable java.lang.String insertion()
default @NonNull Component insertion(@Nullable java.lang.String insertion)
insertion - the insertion stringdefault @NonNull Component mergeColor(@NonNull Component that)
that - the other componentdefault @NonNull Component mergeDecorations(@NonNull Component that)
that - the other componentdefault @NonNull Component mergeEvents(@NonNull Component that)
that - the other componentdefault boolean hasStyling()
true if this component has any styling, false if this
component does not have any styling