Package net.kyori.adventure.text
Class AbstractComponent
- java.lang.Object
-
- net.kyori.adventure.text.AbstractComponent
-
- All Implemented Interfaces:
Component,ComponentBuilderApplicable,ComponentLike,HoverEventSource<Component>,net.kyori.examination.Examinable
public abstract class AbstractComponent extends Object implements Component
An abstract implementation of a text component.- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractComponent(@NotNull List<? extends ComponentLike> children, @NotNull Style style)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull List<Component>children()Gets the unmodifiable list of children.@NotNull Componentcompact()Create a new component with any redundant style elements or children removed.booleanequals(@Nullable Object other)@NotNull Stream<? extends net.kyori.examination.ExaminableProperty>examinableProperties()protected Stream<? extends net.kyori.examination.ExaminableProperty>examinablePropertiesWithoutChildren()inthashCode()@NotNull ComponentreplaceText(@NotNull Consumer<TextReplacementConfig.Builder> configurer)Finds and replaces any text with this or childComponents using the configured options.@NotNull ComponentreplaceText(@NotNull TextReplacementConfig config)Finds and replaces any text with this or childComponents using the provided options.@NotNull Stylestyle()Gets the style of this component.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.kyori.adventure.text.Component
append, append, append, asComponent, asHoverEvent, children, clickEvent, clickEvent, color, color, colorIfAbsent, componentBuilderApply, contains, contains, decorate, decoration, decoration, decoration, decorations, decorations, detectCycle, hasDecoration, hasStyling, hoverEvent, hoverEvent, insertion, insertion, iterable, iterable, iterator, iterator, mergeStyle, mergeStyle, mergeStyle, replaceFirstText, replaceFirstText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, spliterator, spliterator, style, style, style, style
-
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
-
-
-
-
Constructor Detail
-
AbstractComponent
protected AbstractComponent(@NotNull @NotNull List<? extends ComponentLike> children, @NotNull @NotNull Style style)
-
-
Method Detail
-
children
@NotNull public final @NotNull List<Component> children()
Description copied from interface:ComponentGets the unmodifiable list of children.
-
style
@NotNull public final @NotNull Style style()
Description copied from interface:ComponentGets the style of this component.
-
replaceText
@NotNull public @NotNull Component replaceText(@NotNull @NotNull Consumer<TextReplacementConfig.Builder> configurer)
Description copied from interface:ComponentFinds and replaces any text with this or childComponents using the configured options.- Specified by:
replaceTextin interfaceComponent- Parameters:
configurer- the configurer- Returns:
- a modified copy of this component
-
replaceText
@NotNull public @NotNull Component replaceText(@NotNull @NotNull TextReplacementConfig config)
Description copied from interface:ComponentFinds and replaces any text with this or childComponents using the provided options.- Specified by:
replaceTextin interfaceComponent- Parameters:
config- the replacement config- Returns:
- a modified copy of this component
-
compact
@NotNull public @NotNull Component compact()
Description copied from interface:ComponentCreate a new component with any redundant style elements or children removed.
-
examinablePropertiesWithoutChildren
protected Stream<? extends net.kyori.examination.ExaminableProperty> examinablePropertiesWithoutChildren()
-
examinableProperties
@NotNull public @NotNull Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()
- Specified by:
examinablePropertiesin interfacenet.kyori.examination.Examinable
-
-