C - the component typeB - the builder typepublic static interface BuildableComponent.Builder<C extends BuildableComponent,B extends BuildableComponent.Builder<C,B>>
| 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.
|
default B |
apply(@NonNull java.util.function.Consumer<BuildableComponent.Builder<?,?>> consumer)
Applies an action to this builder.
|
B |
applyDeep(@NonNull java.util.function.Consumer<BuildableComponent.Builder<?,?>> action)
Applies an action to this component and all child components if they are
an instance of
BuildableComponent. |
C |
build()
Build a component.
|
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.
|
default B |
decoration(@NonNull TextDecoration decoration,
boolean flag)
Sets the state of a decoration on this component.
|
B |
decoration(@NonNull TextDecoration decoration,
TextDecoration.State state)
Sets the value of a decoration on this component.
|
default B |
decorations(@NonNull java.util.Set<TextDecoration> decorations,
boolean flag)
Sets the state of a set of decorations to
flag 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.
|
default B |
mergeColor(@NonNull Component that)
Merges the color from another component into this component.
|
default B |
mergeDecorations(@NonNull Component that)
Merges the decorations from another component into this component.
|
default B |
mergeEvents(@NonNull Component that)
Merges the events from another component into this component.
|
default B |
mergeStyle(@NonNull Component that)
Merges styling from another component into this component.
|
default B |
resetStyle()
Resets all styling on this component.
|
B append(@NonNull Component component)
component - the component to appendB append(@NonNull java.lang.Iterable<? extends Component> components)
components - the components to appenddefault B apply(@NonNull java.util.function.Consumer<BuildableComponent.Builder<?,?>> consumer)
consumer - the actionB applyDeep(@NonNull java.util.function.Consumer<BuildableComponent.Builder<?,?>> action)
BuildableComponent.action - the actionB mapChildren(@NonNull java.util.function.Function<BuildableComponent<?,?>,BuildableComponent<?,?>> function)
function - the mapping functionB mapChildrenDeep(@NonNull java.util.function.Function<BuildableComponent<?,?>,BuildableComponent<?,?>> function)
function - the mapping functionB color(@Nullable TextColor color)
color - the colorB colorIfAbsent(@Nullable TextColor color)
color - the colordefault B decorations(@NonNull java.util.Set<TextDecoration> decorations, boolean flag)
flag on this component.decorations - the decorationsflag - true if this component should have the decorations, false if
this component should not have the decorationsdefault B 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 decorationB 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 valueB clickEvent(@Nullable ClickEvent event)
event - the click eventB hoverEvent(@Nullable HoverEvent event)
event - the hover eventB insertion(@Nullable java.lang.String insertion)
insertion - the insertion stringdefault B mergeStyle(@NonNull Component that)
that - the other componentdefault B mergeColor(@NonNull Component that)
that - the other componentdefault B mergeDecorations(@NonNull Component that)
that - the other componentdefault B mergeEvents(@NonNull Component that)
that - the other componentdefault B resetStyle()
C build()