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
-
Field Summary
Fields Modifier and Type Field Description protected List<Component>
children
The list of children.protected Style
style
The style of this component.Fields inherited from interface net.kyori.adventure.text.Component
EQUALS, EQUALS_IDENTITY
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractComponent(@NotNull List<? extends ComponentLike> children, @NotNull Style style)
-
Method Summary
Modifier and Type Method Description @NotNull List<Component>
children()
Gets the unmodifiable list of children.boolean
equals(@Nullable Object other)
@NotNull Stream<? extends net.kyori.examination.ExaminableProperty>
examinableProperties()
protected Stream<? extends net.kyori.examination.ExaminableProperty>
examinablePropertiesWithoutChildren()
int
hashCode()
@NotNull Component
replaceText(@NotNull Consumer<TextReplacementConfig.Builder> configurer)
Finds and replaces any text with this or childComponent
s using the configured options.@NotNull Component
replaceText(@NotNull TextReplacementConfig config)
Finds and replaces any text with this or childComponent
s using the provided options.@NotNull Style
style()
Gets the style of this component.String
toString()
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, mergeStyle, mergeStyle, mergeStyle, replaceFirstText, replaceFirstText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, style, style, style, style
Methods inherited from interface net.kyori.examination.Examinable
examinableName, examine
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
-
Field Details
-
children
The list of children. -
style
The style of this component.
-
-
Constructor Details
-
AbstractComponent
protected AbstractComponent(@NotNull @NotNull List<? extends ComponentLike> children, @NotNull @NotNull Style style)
-
-
Method Details
-
children
Description copied from interface:Component
Gets the unmodifiable list of children. -
style
Description copied from interface:Component
Gets the style of this component. -
replaceText
@NotNull public @NotNull Component replaceText(@NotNull @NotNull Consumer<TextReplacementConfig.Builder> configurer)Description copied from interface:Component
Finds and replaces any text with this or childComponent
s using the configured options.- Specified by:
replaceText
in interfaceComponent
- Parameters:
configurer
- the configurer- Returns:
- a modified copy of this component
-
replaceText
Description copied from interface:Component
Finds and replaces any text with this or childComponent
s using the provided options.- Specified by:
replaceText
in interfaceComponent
- Parameters:
config
- the replacement config- Returns:
- a modified copy of this component
-
equals
-
hashCode
public int hashCode() -
examinablePropertiesWithoutChildren
protected Stream<? extends net.kyori.examination.ExaminableProperty> examinablePropertiesWithoutChildren() -
examinableProperties
@NotNull public @NotNull Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()- Specified by:
examinableProperties
in interfacenet.kyori.examination.Examinable
-
toString
-