public abstract class AbstractComponent extends java.lang.Object implements Component
| Modifier and Type | Field and Description |
|---|---|
protected TextDecoration.State |
bold
If this component should have the
bold decoration. |
protected @NonNull java.util.List<Component> |
children
The list of children.
|
protected @Nullable ClickEvent |
clickEvent
The click event to apply to this component.
|
protected @Nullable TextColor |
color
The color of this component.
|
protected @Nullable HoverEvent |
hoverEvent
The hover event to apply to this component.
|
protected @Nullable java.lang.String |
insertion
The string to insert when this component is shift-clicked in chat.
|
protected TextDecoration.State |
italic
If this component should have the
italic decoration. |
protected TextDecoration.State |
obfuscated
If this component should have the
obfuscated decoration. |
protected TextDecoration.State |
strikethrough
If this component should have the
strikethrough decoration. |
protected TextDecoration.State |
underlined
If this component should have the
underlined decoration. |
EMPTY_COMPONENT_LIST| Modifier | Constructor and Description |
|---|---|
protected |
AbstractComponent(@NonNull java.util.List<Component> children,
@Nullable TextColor color,
TextDecoration.State obfuscated,
TextDecoration.State bold,
TextDecoration.State strikethrough,
TextDecoration.State underlined,
TextDecoration.State italic,
@Nullable ClickEvent clickEvent,
@Nullable HoverEvent hoverEvent,
@Nullable java.lang.String insertion) |
| Modifier and Type | Method and Description |
|---|---|
@NonNull java.util.List<Component> |
children()
Gets the unmodifiable list of children.
|
@Nullable ClickEvent |
clickEvent()
Gets the click event of this component.
|
@Nullable TextColor |
color()
Gets the color of this component.
|
TextDecoration.State |
decoration(@NonNull TextDecoration decoration)
Gets the state of a decoration on this component.
|
protected boolean |
equals(@NonNull AbstractComponent that) |
boolean |
equals(@Nullable java.lang.Object other) |
int |
hashCode() |
boolean |
hasStyling()
Tests if this component has any styling.
|
@Nullable HoverEvent |
hoverEvent()
Gets the hover event of this component.
|
@Nullable java.lang.String |
insertion()
Gets the string to be inserted when this component is shift-clicked.
|
protected void |
populateToString(com.google.common.base.MoreObjects.ToStringHelper builder) |
@NonNull java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitappend, clickEvent, color, contains, copy, decoration, decoration, decorations, decorations, detectCycle, hasDecoration, hoverEvent, insertion, mergeColor, mergeDecorations, mergeEvents, mergeStyle, of, of, of, of, of, of, resetStyleprotected final @NonNull java.util.List<Component> children
protected final @Nullable TextColor color
protected final TextDecoration.State obfuscated
obfuscated decoration.protected final TextDecoration.State bold
bold decoration.protected final TextDecoration.State strikethrough
strikethrough decoration.protected final TextDecoration.State underlined
underlined decoration.protected final TextDecoration.State italic
italic decoration.protected final @Nullable ClickEvent clickEvent
protected final @Nullable HoverEvent hoverEvent
protected final @Nullable java.lang.String insertion
protected AbstractComponent(@NonNull java.util.List<Component> children, @Nullable TextColor color, TextDecoration.State obfuscated, TextDecoration.State bold, TextDecoration.State strikethrough, TextDecoration.State underlined, TextDecoration.State italic, @Nullable ClickEvent clickEvent, @Nullable HoverEvent hoverEvent, @Nullable java.lang.String insertion)
public @NonNull java.util.List<Component> children()
Componentpublic @Nullable TextColor color()
Componentpublic TextDecoration.State decoration(@NonNull TextDecoration decoration)
Componentdecoration in interface Componentdecoration - 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 setpublic @Nullable ClickEvent clickEvent()
ComponentclickEvent in interface Componentpublic @Nullable HoverEvent hoverEvent()
ComponenthoverEvent in interface Componentpublic @Nullable java.lang.String insertion()
Componentpublic boolean hasStyling()
ComponenthasStyling in interface Componenttrue if this component has any styling, false if this
component does not have any stylingpublic boolean equals(@Nullable java.lang.Object other)
equals in class java.lang.Objectprotected boolean equals(@NonNull AbstractComponent that)
public int hashCode()
hashCode in class java.lang.Objectpublic @NonNull java.lang.String toString()
toString in class java.lang.Objectprotected void populateToString(com.google.common.base.MoreObjects.ToStringHelper builder)