Interface Component

All Superinterfaces:
ComponentLike
All Known Subinterfaces:
BuildableComponent<C,B>, ListComponent, NumberComponent, TemporalComponent, TextComponent, TranslatableComponent

public interface Component extends ComponentLike
A component is an immutable object that represents something that can be displayed to a receiver. This can be a simple text, locale specific objects like dates or numbers or even translations.
  • Method Details

    • getTextStyle

      TextStyle getTextStyle()
      Returns the text textStyle of this component.
    • append

      default ListComponent append(ComponentLike component)
      Appends the given component to this component.
      Parameters:
      component - the component to append
      Returns:
      the concatenated component
    • compress

      default Component compress()
      Compresses this component. Removing empty subcommands and/or merging subcomponents if necessary.
      Returns:
      the compressed component
    • asComponent

      default Component asComponent()
      Description copied from interface: ComponentLike
      Converts this object to a Component.
      Specified by:
      asComponent in interface ComponentLike