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(char value)
Creates a text component with the content of
String.valueOf(char). |
static @NonNull TextComponent |
of(double value)
Creates a text component with the content of
String.valueOf(double). |
static @NonNull TextComponent |
of(float value)
Creates a text component with the content of
String.valueOf(float). |
static @NonNull TextComponent |
of(int value)
Creates a text component with the content of
String.valueOf(int). |
static @NonNull TextComponent |
of(long value)
Creates a text component with the content of
String.valueOf(long). |
static @NonNull TextComponent |
of(@NonNull java.lang.String content)
Creates a text component with content.
|
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.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 of(@NonNull java.lang.String content)
content - the plain text contentstatic @NonNull TextComponent of(boolean value)
String.valueOf(boolean).value - the boolean valuestatic @NonNull TextComponent of(char value)
String.valueOf(char).value - the char valuestatic @NonNull TextComponent of(double value)
String.valueOf(double).value - the double valuestatic @NonNull TextComponent of(float value)
String.valueOf(float).value - the float valuestatic @NonNull TextComponent of(int value)
String.valueOf(int).value - the int valuestatic @NonNull TextComponent of(long value)
String.valueOf(long).value - the long valuestatic @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 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 configuratorstatic @NonNull TextComponent empty()
static @NonNull TextComponent newline()
static @NonNull TextComponent space()
@NonNull java.lang.String content()
@NonNull TextComponent content(@NonNull java.lang.String content)
content - the plain text content