public class KeybindComponent extends AbstractBuildableComponent<KeybindComponent,KeybindComponent.Builder>
| Modifier and Type | Class and Description |
|---|---|
static class |
KeybindComponent.Builder
A keybind component builder.
|
AbstractBuildableComponent.AbstractBuilder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>bold, children, clickEvent, color, hoverEvent, insertion, italic, obfuscated, strikethrough, underlinedEMPTY_COMPONENT_LIST| Modifier | Constructor and Description |
|---|---|
protected |
KeybindComponent(@NonNull KeybindComponent.Builder builder) |
protected |
KeybindComponent(@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,
@NonNull java.lang.String keybind) |
| Modifier and Type | Method and Description |
|---|---|
@NonNull KeybindComponent |
append(@NonNull Component component)
Appends a component to this component.
|
static KeybindComponent.Builder |
builder()
Creates a keybind component builder.
|
static KeybindComponent.Builder |
builder(@NonNull java.lang.String keybind)
Creates a keybind component builder with a keybind.
|
@NonNull KeybindComponent |
clickEvent(@Nullable ClickEvent event)
Sets the click event of this component.
|
@NonNull KeybindComponent |
color(@Nullable TextColor color)
Sets the color of this component.
|
@NonNull KeybindComponent |
copy()
Creates a component.
|
@NonNull KeybindComponent |
decoration(@NonNull TextDecoration decoration,
boolean flag)
Sets the state of a decoration on this component.
|
@NonNull KeybindComponent |
decoration(@NonNull TextDecoration decoration,
TextDecoration.State state)
Sets the value of a decoration on this component.
|
boolean |
equals(@Nullable java.lang.Object other) |
int |
hashCode() |
@NonNull KeybindComponent |
hoverEvent(@Nullable HoverEvent event)
Sets the hover event of this component.
|
@NonNull KeybindComponent |
insertion(@Nullable java.lang.String insertion)
Sets the string to be inserted when this component is shift-clicked.
|
@NonNull java.lang.String |
keybind()
Gets the keybind.
|
@NonNull KeybindComponent |
keybind(@NonNull java.lang.String keybind)
Sets the keybind.
|
static KeybindComponent |
make(@NonNull java.util.function.Consumer<KeybindComponent.Builder> consumer)
Creates a keybind component by applying configuration from
consumer. |
static KeybindComponent |
make(@NonNull java.lang.String keybind,
@NonNull java.util.function.Consumer<KeybindComponent.Builder> consumer)
Creates a keybind component by applying configuration from
consumer. |
@NonNull KeybindComponent |
mergeColor(@NonNull Component that)
Merges the color from another component into this component.
|
@NonNull KeybindComponent |
mergeDecorations(@NonNull Component that)
Merges the decorations from another component into this component.
|
@NonNull KeybindComponent |
mergeEvents(@NonNull Component that)
Merges the events from another component into this component.
|
@NonNull KeybindComponent |
mergeStyle(@NonNull Component that)
Merges styling from another component into this component.
|
static KeybindComponent |
of(@NonNull java.lang.String keybind)
Creates a keybind component with a keybind.
|
static KeybindComponent |
of(@NonNull java.lang.String keybind,
@Nullable TextColor color)
Creates a keybind component with content, and optional color.
|
static KeybindComponent |
of(@NonNull java.lang.String keybind,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations)
Creates a keybind component with content, and optional color and decorations.
|
protected void |
populateToString(com.google.common.base.MoreObjects.ToStringHelper builder) |
@NonNull KeybindComponent |
resetStyle()
Resets all styling on this component.
|
@NonNull KeybindComponent.Builder |
toBuilder()
Create a builder from this component.
|
children, clickEvent, color, decoration, equals, hasStyling, hoverEvent, insertion, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitchildren, clickEvent, color, contains, decoration, decorations, decorations, detectCycle, hasDecoration, hasStyling, hoverEvent, insertion, of, of, of, of, of, ofprotected KeybindComponent(@NonNull KeybindComponent.Builder builder)
protected KeybindComponent(@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, @NonNull java.lang.String keybind)
public static KeybindComponent.Builder builder()
public static KeybindComponent.Builder builder(@NonNull java.lang.String keybind)
keybind - the keybindpublic static KeybindComponent of(@NonNull java.lang.String keybind)
keybind - the keybindpublic static KeybindComponent of(@NonNull java.lang.String keybind, @Nullable TextColor color)
keybind - the keybindcolor - the colorpublic static KeybindComponent of(@NonNull java.lang.String keybind, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations)
keybind - the keybindcolor - the colordecorations - the decorationspublic static KeybindComponent make(@NonNull java.util.function.Consumer<KeybindComponent.Builder> consumer)
consumer.consumer - the builder configuratorpublic static KeybindComponent make(@NonNull java.lang.String keybind, @NonNull java.util.function.Consumer<KeybindComponent.Builder> consumer)
consumer.keybind - the keybindconsumer - the builder configuratorpublic @NonNull java.lang.String keybind()
public @NonNull KeybindComponent keybind(@NonNull java.lang.String keybind)
keybind - the keybindpublic @NonNull KeybindComponent append(@NonNull Component component)
Componentcomponent - the component to appendpublic @NonNull KeybindComponent color(@Nullable TextColor color)
Componentcolor - the colorpublic @NonNull KeybindComponent decoration(@NonNull TextDecoration decoration, boolean flag)
Componentdecoration - the decorationflag - true if this component should have the decoration, false if
this component should not have the decorationpublic @NonNull KeybindComponent decoration(@NonNull TextDecoration decoration, TextDecoration.State state)
Componentdecoration - 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 @NonNull KeybindComponent clickEvent(@Nullable ClickEvent event)
Componentevent - the click eventpublic @NonNull KeybindComponent hoverEvent(@Nullable HoverEvent event)
Componentevent - the hover eventpublic @NonNull KeybindComponent insertion(@Nullable java.lang.String insertion)
Componentinsertion - the insertion stringpublic @NonNull KeybindComponent mergeStyle(@NonNull Component that)
Componentthat - the other componentpublic @NonNull KeybindComponent mergeColor(@NonNull Component that)
Componentthat - the other componentpublic @NonNull KeybindComponent mergeDecorations(@NonNull Component that)
Componentthat - the other componentpublic @NonNull KeybindComponent mergeEvents(@NonNull Component that)
Componentthat - the other componentpublic @NonNull KeybindComponent resetStyle()
Componentpublic @NonNull KeybindComponent copy()
Componentpublic boolean equals(@Nullable java.lang.Object other)
equals in class AbstractComponentpublic int hashCode()
hashCode in class AbstractComponentprotected void populateToString(com.google.common.base.MoreObjects.ToStringHelper builder)
populateToString in class AbstractComponentpublic @NonNull KeybindComponent.Builder toBuilder()
BuildableComponent