C - the component typeB - the builder typeprotected abstract static class AbstractBuildableComponent.AbstractBuilder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>> extends java.lang.Object implements BuildableComponent.Builder<C,B>
| 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. |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBuilder() |
protected |
AbstractBuilder(C component) |
| Modifier and Type | Method and Description |
|---|---|
B |
append(@NonNull Component component)
Appends a component to this component.
|
B |
append(@NonNull java.lang.Iterable<? extends Component> components)
Appends components to this component.
|
B |
applyDeep(@NonNull java.util.function.Consumer<BuildableComponent.Builder<?,?>> consumer)
Applies an action to this component and all child components if they are
an instance of
BuildableComponent. |
B |
clickEvent(@Nullable ClickEvent event)
Sets the click event of this component.
|
B |
color(@Nullable TextColor color)
Sets the color of this component.
|
B |
colorIfAbsent(@Nullable TextColor color)
Sets the color of this component if there isn't one set already.
|
B |
decoration(@NonNull TextDecoration decoration,
TextDecoration.State state)
Sets the value of a decoration on this component.
|
B |
hoverEvent(@Nullable HoverEvent event)
Sets the hover event of this component.
|
B |
insertion(@Nullable java.lang.String insertion)
Sets the string to be inserted when this component is shift-clicked.
|
B |
mapChildren(@NonNull java.util.function.Function<BuildableComponent<?,?>,BuildableComponent<?,?>> function)
Replaces each child of this component with the resultant component from the function.
|
B |
mapChildrenDeep(@NonNull java.util.function.Function<BuildableComponent<?,?>,BuildableComponent<?,?>> function)
Replaces each child and sub-child of this component with the resultant
component of the function.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapply, build, decoration, decorations, mergeColor, mergeDecorations, mergeEvents, mergeStyle, resetStyleprotected @NonNull java.util.List<Component> children
This list is set to an empty list of components
by default to prevent unnecessary list creation for components with no children.
protected @Nullable TextColor color
protected TextDecoration.State obfuscated
obfuscated decoration.protected TextDecoration.State bold
bold decoration.protected TextDecoration.State strikethrough
strikethrough decoration.protected TextDecoration.State underlined
underlined decoration.protected TextDecoration.State italic
italic decoration.protected @Nullable ClickEvent clickEvent
protected @Nullable HoverEvent hoverEvent
protected @Nullable java.lang.String insertion
protected AbstractBuilder()
protected AbstractBuilder(C component)
public B append(@NonNull Component component)
BuildableComponent.Builderappend in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>component - the component to appendpublic B append(@NonNull java.lang.Iterable<? extends Component> components)
BuildableComponent.Builderappend in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>components - the components to appendpublic B applyDeep(@NonNull java.util.function.Consumer<BuildableComponent.Builder<?,?>> consumer)
BuildableComponent.BuilderBuildableComponent.applyDeep in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>consumer - the actionpublic B mapChildren(@NonNull java.util.function.Function<BuildableComponent<?,?>,BuildableComponent<?,?>> function)
BuildableComponent.BuildermapChildren in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>function - the mapping functionpublic B mapChildrenDeep(@NonNull java.util.function.Function<BuildableComponent<?,?>,BuildableComponent<?,?>> function)
BuildableComponent.BuildermapChildrenDeep in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>function - the mapping functionpublic B color(@Nullable TextColor color)
BuildableComponent.Buildercolor in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>color - the colorpublic B colorIfAbsent(@Nullable TextColor color)
BuildableComponent.BuildercolorIfAbsent in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>color - the colorpublic B decoration(@NonNull TextDecoration decoration, TextDecoration.State state)
BuildableComponent.Builderdecoration in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>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 valuepublic B clickEvent(@Nullable ClickEvent event)
BuildableComponent.BuilderclickEvent in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>event - the click eventpublic B hoverEvent(@Nullable HoverEvent event)
BuildableComponent.BuilderhoverEvent in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>event - the hover eventpublic B insertion(@Nullable java.lang.String insertion)
BuildableComponent.Builderinsertion in interface BuildableComponent.Builder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>insertion - the insertion string