public interface TextComponent extends BuildableComponent<TextComponent,TextComponent.Builder>, ScopedComponent<TextComponent>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
TextComponent.Builder
A text component builder.
|
| Modifier and Type | Method and Description |
|---|---|
static @NonNull TextComponent.Builder |
builder()
Creates a text component builder.
|
static @NonNull TextComponent.Builder |
builder(@NonNull java.lang.String content)
Creates a text component builder with content.
|
static @NonNull TextComponent.Builder |
builder(@NonNull java.lang.String content,
@Nullable TextColor color)
Creates a text component builder with content, and optional color.
|
@NonNull java.lang.String |
content()
Gets the plain text content.
|
@NonNull TextComponent |
content(@NonNull java.lang.String content)
Sets the plain text content.
|
static @NonNull TextComponent |
empty()
Gets a text component with empty content.
|
static @NonNull TextComponent |
make(@NonNull java.util.function.Consumer<? super TextComponent.Builder> consumer)
Creates a text component by applying configuration from
consumer. |
static @NonNull TextComponent |
make(@NonNull java.lang.String content,
@NonNull java.util.function.Consumer<? super TextComponent.Builder> consumer)
Creates a text component by applying configuration from
consumer. |
static @NonNull TextComponent |
newline()
Gets a text component with a new line character as the content.
|
static @NonNull TextComponent |
of(boolean value)
Creates a text component with the content of
String.valueOf(boolean). |
static @NonNull TextComponent |
of(boolean value,
@NonNull Style style)
Creates a text component with the content of
String.valueOf(boolean) and styling. |
static @NonNull TextComponent |
of(boolean value,
@Nullable TextColor color)
Creates a text component with the content of
String.valueOf(boolean), and optional color. |
static @NonNull TextComponent |
of(boolean value,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations)
Creates a text component with the content of
String.valueOf(boolean), and optional color and decorations. |
static @NonNull TextComponent |
of(boolean value,
@Nullable TextColor color,
TextDecoration... decorations)
Creates a text component with the content of
String.valueOf(boolean), and optional color and decorations. |
static @NonNull TextComponent |
of(char value)
Creates a text component with the content of
String.valueOf(char). |
static @NonNull TextComponent |
of(char value,
@NonNull Style style)
Creates a text component with the content of
String.valueOf(char) and styling. |
static @NonNull TextComponent |
of(char value,
@Nullable TextColor color)
Creates a text component with the content of
String.valueOf(char), and optional color. |
static @NonNull TextComponent |
of(char value,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations)
Creates a text component with the content of
String.valueOf(char), and optional color and decorations. |
static @NonNull TextComponent |
of(char value,
@Nullable TextColor color,
TextDecoration... decorations)
Creates a text component with the content of
String.valueOf(char), and optional color and decorations. |
static @NonNull TextComponent |
of(double value)
Creates a text component with the content of
String.valueOf(double). |
static @NonNull TextComponent |
of(double value,
@NonNull Style style)
Creates a text component with the content of
String.valueOf(double) and styling. |
static @NonNull TextComponent |
of(double value,
@Nullable TextColor color)
Creates a text component with the content of
String.valueOf(double), and optional color. |
static @NonNull TextComponent |
of(double value,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations)
Creates a text component with the content of
String.valueOf(double), and optional color and decorations. |
static @NonNull TextComponent |
of(double value,
@Nullable TextColor color,
TextDecoration... decorations)
Creates a text component with the content of
String.valueOf(double), and optional color and decorations. |
static @NonNull TextComponent |
of(float value)
Creates a text component with the content of
String.valueOf(float). |
static @NonNull TextComponent |
of(float value,
@NonNull Style style)
Creates a text component with the content of
String.valueOf(float) and styling. |
static @NonNull TextComponent |
of(float value,
@Nullable TextColor color)
Creates a text component with the content of
String.valueOf(float), and optional color. |
static @NonNull TextComponent |
of(float value,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations)
Creates a text component with the content of
String.valueOf(float), and optional color and decorations. |
static @NonNull TextComponent |
of(float value,
@Nullable TextColor color,
TextDecoration... decorations)
Creates a text component with the content of
String.valueOf(float), and optional color and decorations. |
static @NonNull TextComponent |
of(int value)
Creates a text component with the content of
String.valueOf(int). |
static @NonNull TextComponent |
of(int value,
@NonNull Style style)
Creates a text component with the content of
String.valueOf(int) and styling. |
static @NonNull TextComponent |
of(int value,
@Nullable TextColor color)
Creates a text component with the content of
String.valueOf(int), and optional color. |
static @NonNull TextComponent |
of(int value,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations)
Creates a text component with the content of
String.valueOf(int), and optional color and decorations. |
static @NonNull TextComponent |
of(int value,
@Nullable TextColor color,
TextDecoration... decorations)
Creates a text component with the content of
String.valueOf(int), and optional color and decorations. |
static @NonNull TextComponent |
of(long value)
Creates a text component with the content of
String.valueOf(long). |
static @NonNull TextComponent |
of(long value,
@NonNull Style style)
Creates a text component with the content of
String.valueOf(long) and styling. |
static @NonNull TextComponent |
of(long value,
@Nullable TextColor color)
Creates a text component with the content of
String.valueOf(long), and optional color. |
static @NonNull TextComponent |
of(long value,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations)
Creates a text component with the content of
String.valueOf(long), and optional color and decorations. |
static @NonNull TextComponent |
of(long value,
@Nullable TextColor color,
TextDecoration... decorations)
Creates a text component with the content of
String.valueOf(long), and optional color and decorations. |
static @NonNull TextComponent |
of(@NonNull java.lang.String content)
Creates a text component with content.
|
static @NonNull TextComponent |
of(@NonNull java.lang.String content,
@NonNull Style style)
Creates a text component with content and styling.
|
static @NonNull TextComponent |
of(@NonNull java.lang.String content,
@Nullable TextColor color)
Creates a text component with content, and optional color.
|
static @NonNull TextComponent |
of(@NonNull java.lang.String content,
@Nullable TextColor color,
@NonNull java.util.Set<TextDecoration> decorations)
Creates a text component with content, and optional color and decorations.
|
static @NonNull TextComponent |
of(@NonNull java.lang.String content,
@Nullable TextColor color,
TextDecoration... decorations)
Creates a text component with content, and optional color and decorations.
|
static @NonNull TextComponent |
space()
Gets a text immutable component with a single space as the content.
|
toBuilderappend, append, children, clickEvent, color, decoration, decoration, hoverEvent, insertion, mergeColor, mergeDecorations, mergeEventschildren, clickEvent, color, contains, decoration, decorations, decorations, detectCycle, hasDecoration, hasStyling, hoverEvent, insertion, style, stylestatic @NonNull TextComponent empty()
static @NonNull TextComponent newline()
static @NonNull TextComponent space()
static @NonNull TextComponent of(@NonNull java.lang.String content)
content - the plain text contentstatic @NonNull TextComponent of(@NonNull java.lang.String content, @Nullable TextColor color)
content - the plain text contentcolor - the colorstatic @NonNull TextComponent of(@NonNull java.lang.String content, @Nullable TextColor color, TextDecoration... decorations)
content - the plain text contentcolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(@NonNull java.lang.String content, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations)
content - the plain text contentcolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(@NonNull java.lang.String content, @NonNull Style style)
content - the plain text contentstyle - the stylestatic @NonNull TextComponent of(boolean value)
String.valueOf(boolean).value - the boolean valuestatic @NonNull TextComponent of(boolean value, @Nullable TextColor color)
String.valueOf(boolean), and optional color.value - the boolean valuecolor - the colorstatic @NonNull TextComponent of(boolean value, @Nullable TextColor color, TextDecoration... decorations)
String.valueOf(boolean), and optional color and decorations.value - the boolean valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(boolean value, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations)
String.valueOf(boolean), and optional color and decorations.value - the boolean valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(boolean value, @NonNull Style style)
String.valueOf(boolean) and styling.value - the boolean valuestyle - the stylestatic @NonNull TextComponent of(char value)
String.valueOf(char).value - the char valuestatic @NonNull TextComponent of(char value, @Nullable TextColor color)
String.valueOf(char), and optional color.value - the char valuecolor - the colorstatic @NonNull TextComponent of(char value, @Nullable TextColor color, TextDecoration... decorations)
String.valueOf(char), and optional color and decorations.value - the char valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(char value, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations)
String.valueOf(char), and optional color and decorations.value - the char valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(char value, @NonNull Style style)
String.valueOf(char) and styling.value - the char valuestyle - the stylestatic @NonNull TextComponent of(double value)
String.valueOf(double).value - the double valuestatic @NonNull TextComponent of(double value, @Nullable TextColor color)
String.valueOf(double), and optional color.value - the double valuecolor - the colorstatic @NonNull TextComponent of(double value, @Nullable TextColor color, TextDecoration... decorations)
String.valueOf(double), and optional color and decorations.value - the double valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(double value, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations)
String.valueOf(double), and optional color and decorations.value - the double valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(double value, @NonNull Style style)
String.valueOf(double) and styling.value - the double valuestyle - the stylestatic @NonNull TextComponent of(float value)
String.valueOf(float).value - the float valuestatic @NonNull TextComponent of(float value, @Nullable TextColor color)
String.valueOf(float), and optional color.value - the float valuecolor - the colorstatic @NonNull TextComponent of(float value, @Nullable TextColor color, TextDecoration... decorations)
String.valueOf(float), and optional color and decorations.value - the float valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(float value, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations)
String.valueOf(float), and optional color and decorations.value - the float valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(float value, @NonNull Style style)
String.valueOf(float) and styling.value - the float valuestyle - the stylestatic @NonNull TextComponent of(int value)
String.valueOf(int).value - the int valuestatic @NonNull TextComponent of(int value, @Nullable TextColor color)
String.valueOf(int), and optional color.value - the int valuecolor - the colorstatic @NonNull TextComponent of(int value, @Nullable TextColor color, TextDecoration... decorations)
String.valueOf(int), and optional color and decorations.value - the int valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(int value, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations)
String.valueOf(int), and optional color and decorations.value - the int valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(int value, @NonNull Style style)
String.valueOf(int) and styling.value - the int valuestyle - the stylestatic @NonNull TextComponent of(long value)
String.valueOf(long).value - the long valuestatic @NonNull TextComponent of(long value, @Nullable TextColor color)
String.valueOf(long), and optional color.value - the long valuecolor - the colorstatic @NonNull TextComponent of(long value, @Nullable TextColor color, TextDecoration... decorations)
String.valueOf(long), and optional color and decorations.value - the long valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(long value, @Nullable TextColor color, @NonNull java.util.Set<TextDecoration> decorations)
String.valueOf(long), and optional color and decorations.value - the long valuecolor - the colordecorations - the decorationsstatic @NonNull TextComponent of(long value, @NonNull Style style)
String.valueOf(long) and styling.value - the long valuestyle - the stylestatic @NonNull TextComponent.Builder builder()
static @NonNull TextComponent.Builder builder(@NonNull java.lang.String content)
content - the plain text contentstatic @NonNull TextComponent.Builder builder(@NonNull java.lang.String content, @Nullable TextColor color)
content - the plain text contentcolor - the colorstatic @NonNull TextComponent make(@NonNull java.util.function.Consumer<? super TextComponent.Builder> consumer)
consumer.consumer - the builder configuratorstatic @NonNull TextComponent make(@NonNull java.lang.String content, @NonNull java.util.function.Consumer<? super TextComponent.Builder> consumer)
consumer.content - the plain text contentconsumer - the builder configurator@NonNull java.lang.String content()
@NonNull TextComponent content(@NonNull java.lang.String content)
content - the plain text content