Interface ReactiveComponent<V>

Type Parameters:
V - Value of the reactive state.
All Superinterfaces:
net.kyori.adventure.util.Buildable<net.kyori.adventure.text.TextComponent,net.kyori.adventure.text.TextComponent.Builder>, net.kyori.adventure.text.BuildableComponent<net.kyori.adventure.text.TextComponent,net.kyori.adventure.text.TextComponent.Builder>, net.kyori.adventure.text.Component, net.kyori.adventure.text.ComponentBuilderApplicable, net.kyori.adventure.text.ComponentLike, net.kyori.examination.Examinable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.Component>, ReactiveSubscriber<V>, net.kyori.adventure.text.ScopedComponent<net.kyori.adventure.text.TextComponent>, net.kyori.adventure.text.format.StyleGetter, net.kyori.adventure.text.format.StyleSetter<net.kyori.adventure.text.Component>, net.kyori.adventure.text.TextComponent

@ThreadSafe public sealed interface ReactiveComponent<V> extends ReactiveSubscriber<V>, net.kyori.adventure.text.TextComponent
A reactive component can be subscribed to a ReactiveState, and will recalculate itself based on state change.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.kyori.adventure.text.TextComponent

    net.kyori.adventure.text.TextComponent.Builder
  • Field Summary

    Fields inherited from interface net.kyori.adventure.text.Component

    EQUALS, EQUALS_IDENTITY, IS_NOT_EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull net.kyori.adventure.text.TextComponent
    Gets parent text component that will be mutated on state change
    static <T> @NotNull ReactiveComponent<T>
    reactive(org.apache.commons.lang3.concurrent.Computable<T,net.kyori.adventure.text.Component> producer)
    Constructs a new non-subscribed empty reactive component

    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.examination.Examinable

    examinableName, examine

    Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource

    asHoverEvent

    Methods inherited from interface space.maxus.flare.react.ReactiveSubscriber

    onStateChange

    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

    Methods inherited from interface net.kyori.adventure.text.TextComponent

    content, content, examinableProperties
  • Method Details

    • reactive

      @NotNull static <T> @NotNull ReactiveComponent<T> reactive(org.apache.commons.lang3.concurrent.Computable<T,net.kyori.adventure.text.Component> producer)
      Constructs a new non-subscribed empty reactive component
      Type Parameters:
      T - Type of the reactive state value
      Parameters:
      producer - Producer to be used for component building
      Returns:
      New reactive component
    • getParent

      @NotNull @NotNull net.kyori.adventure.text.TextComponent getParent()
      Gets parent text component that will be mutated on state change
      Returns:
      Parent text component