Accept setting data-provider of subclasses
See original GitHub issueNot sure if I’m missing some Java generics basics, but why it isn’t possible to set a DataProvider<Bar, ?>
to a ComboBox<Foo>
, if Bar extends Foo
?
In other words, can the signature of HasDataProvider#setDataProvider
be changed from:
void setDataProvider(DataProvider<T, ?> dataProvider);
to
void setDataProvider(DataProvider<? extends T, ?> dataProvider);
? It would really simplify the codebase, since now I need a DP for every subtype I have.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Defining dataProviderClass in a subclass · Issue #1691 - GitHub
First define a custom annotation that lets you express the data provider class and name. import java.lang.annotation.Retention; import java.lang ...
Read more >How to properly test subclasses with phpspec dataprovider
If I hard-code those values then the test is green. However I want to test varios prices and results, so I decided to...
Read more >running groups of classes which inherit test methods from a ...
I created a base class which contained an elaborate data provider and a series of (integration) tests which depend on being run in...
Read more >Interface DataProvider<T,F> - Vaadin
The DataProvider interface is used by listing components implementing HasDataProvider or HasFilterableDataProvider .
Read more >NEFilterDataProvider | Apple Developer Documentation
To create a Filter Data Provider extension, you must first create a subclass of NEFilterDataProvider and override the methods listed below. Methods to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@knoobie sure - but this is not a priority in itself and we will not break all data provider components just because of this. In case we need to make breaking things anyway, then we can include this too, but otherwise this is a secondary priority.
For any new added API, we will take this into account and not tie the type parameter like we did earlier.
As now we went with not breaking any existing data providers and partly hiding the data provider as an abstraction level so one does not have use a data provider to set the data to the component (either in-memory or lazy). So while it is still fine to use data providers, it is not mandatory and thus I don’t see this breaking change happening as it would further complicate things.