flow
flow copied to clipboard
Add upper bound wildcard to HasComponents.add()
trafficstars
Describe your motivation
Say I have a List<Button>, I'd like to be able to call verticalLayout.add(buttons) but I can't: Java compiler says there's no add(List<Button>) function.
Describe the solution you'd like
The HasComponents.add() should be changed to add(Collection<? extends Component> components).
Workaround is to call add((Collection<Component>) buttons); but that emits a compiler warning, so it's not pretty.
Vaadin 24.3.3
Makes sense to do this 👍