Package net.kyori.adventure.text
Interface TextComponent
-
- All Superinterfaces:
Buildable<TextComponent,TextComponent.Builder>
,BuildableComponent<TextComponent,TextComponent.Builder>
,Component
,ComponentBuilderApplicable
,ComponentLike
,net.kyori.examination.Examinable
,HoverEventSource<Component>
,ScopedComponent<TextComponent>
,StyleGetter
,StyleSetter<Component>
public interface TextComponent extends BuildableComponent<TextComponent,TextComponent.Builder>, ScopedComponent<TextComponent>
A component that displays a string.This component consists of:
- content
- string to be displayed
- Since:
- 4.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
TextComponent.Builder
A text component builder.
-
Field Summary
-
Fields inherited from interface net.kyori.adventure.text.Component
EQUALS, EQUALS_IDENTITY, IS_NOT_EMPTY
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description @NotNull java.lang.String
content()
Gets the plain text content.@NotNull TextComponent
content(@NotNull java.lang.String content)
Sets the plain text content.default @NotNull java.util.stream.Stream<? extends net.kyori.examination.ExaminableProperty>
examinableProperties()
static @NotNull TextComponent
ofChildren(@NotNull ComponentLike @NotNull ... components)
Deprecated.for removal since 4.9.0, useComponent.textOfChildren(ComponentLike...)
instead-
Methods inherited from interface net.kyori.adventure.text.BuildableComponent
toBuilder
-
Methods inherited from interface net.kyori.adventure.text.Component
appendNewline, appendSpace, applyFallbackStyle, applyFallbackStyle, asComponent, asHoverEvent, children, clickEvent, color, compact, componentBuilderApply, contains, contains, decoration, decorationIfAbsent, decorations, decorations, detectCycle, font, font, hasDecoration, hasStyling, hoverEvent, insertion, iterable, iterable, iterator, iterator, replaceFirstText, replaceFirstText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, spliterator, spliterator, style, style
-
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
-
Methods inherited from interface net.kyori.adventure.text.ScopedComponent
append, append, append, children, clickEvent, color, colorIfAbsent, decorate, decoration, decoration, hoverEvent, insertion, mergeStyle, mergeStyle, mergeStyle, style, style, style
-
Methods inherited from interface net.kyori.adventure.text.format.StyleSetter
decorate, decorations
-
-
-
-
Method Detail
-
ofChildren
@ScheduledForRemoval(inVersion="5.0.0") @Deprecated @NotNull static @NotNull TextComponent ofChildren(@NotNull @NotNull ComponentLike @NotNull ... components)
Deprecated.for removal since 4.9.0, useComponent.textOfChildren(ComponentLike...)
insteadCreates a component withcomponents
as the children.- Parameters:
components
- the children- Returns:
- a text component
- Since:
- 4.0.0
-
content
@NotNull @NotNull java.lang.String content()
Gets the plain text content.- Returns:
- the plain text content
- Since:
- 4.0.0
-
content
@Contract(pure=true) @NotNull @NotNull TextComponent content(@NotNull @NotNull java.lang.String content)
Sets the plain text content.- Parameters:
content
- the plain text content- Returns:
- a copy of this component
- Since:
- 4.0.0
-
examinableProperties
@NotNull default @NotNull java.util.stream.Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()
- Specified by:
examinableProperties
in interfaceComponent
- Specified by:
examinableProperties
in interfacenet.kyori.examination.Examinable
-
-