Interface SequencedComponent<T extends Component>

Type Parameters:
T - the component type this container supports.
All Superinterfaces:
LocalizedComponent
All Known Implementing Classes:
AbstractSequencedContainer, SeparatedContainer, SequencedContainer, SequencedTextDisplay, TextDisplayContainer

public sealed interface SequencedComponent<T extends Component> extends LocalizedComponent permits SequencedTextDisplay, AbstractSequencedContainer<E,R>

An interface for Components that allow adding its elements in sequence.

Example

SequencedComponent<ContainerChildComponent> container = SequencedContainer.of(TextDisplay.of("Hello World!"));

container.add(Separator.createDivider(Spacing.SMALL));

container.add(TextDisplay.of("Goodbye World"));
  • Method Details

    • add

      SequencedComponent<T> add(T component, Entry... entries)
      Appends the provided element to the end of this component.
      Parameters:
      component - the element to add
      entries - the Entries used for localization
      Returns:
      this instance for fluent interface
    • addFirst

      SequencedComponent<T> addFirst(T component, Entry... entries)
      Adds the provided element to this component as the first element of this component.
      Parameters:
      component - the element to add
      entries - the Entries used for localization
      Returns:
      this instance for fluent interface
    • addLast

      SequencedComponent<T> addLast(T component, Entry... entries)
      Adds the provided element to this component as the last element of this component.
      Parameters:
      component - the element to add
      entries - the Entries used for localization
      Returns:
      this instance for fluent interface
    • addAll

      SequencedComponent<T> addAll(Collection<T> component, Entry... entries)
      Appends all the elements in the specified collection to the end of this component.
      Parameters:
      component - the elements to add
      entries - the Entries used for localization
      Returns:
      this instance for fluent interface