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 Summary
Modifier and TypeMethodDescriptionAppends the provided element to the end of this component.addAll(Collection<T> component, Entry... entries) Appends all the elements in the specified collection to the end of this component.Adds the provided element to this component as the first element of this component.Adds the provided element to this component as the last element of this component.
-
Method Details
-
add
Appends the provided element to the end of this component.- Parameters:
component- the element to addentries- the Entries used for localization- Returns:
- this instance for fluent interface
-
addFirst
Adds the provided element to this component as the first element of this component.- Parameters:
component- the element to addentries- the Entries used for localization- Returns:
- this instance for fluent interface
-
addLast
Adds the provided element to this component as the last element of this component.- Parameters:
component- the element to addentries- the Entries used for localization- Returns:
- this instance for fluent interface
-
addAll
Appends all the elements in the specified collection to the end of this component.- Parameters:
component- the elements to addentries- the Entries used for localization- Returns:
- this instance for fluent interface
-