]> source.dussan.org Git - vaadin-framework.git/commit
Combine and rename setFilter and applyFilter (#7963)
authorLeif Åstrand <legioth@gmail.com>
Thu, 15 Dec 2016 08:00:09 +0000 (10:00 +0200)
committerPekka Hyvönen <pekka@vaadin.com>
Thu, 15 Dec 2016 08:00:09 +0000 (10:00 +0200)
commit9e62f59b36fb71329e752be0c6f039c27198d582
treea75a4d8f28756e16bd266086612b30c186c9078f
parent66e7b3df3d96c221933618d06a3e25360db1b6b7
Combine and rename setFilter and applyFilter (#7963)

setFilter is an unsuitable name since it looks like a setter even though
it isn't one. It's therefore renamed to withFilter.

The difference between setFilter and applyFilter is very confusing. The
original reason for the distinction was that they had incompatible
return types (Void vs F), but this is resolved by changing the
non-appendable version to use ? instead of Void.

One side effect of this change is that setFilter cannot be used on an
appendable filter provider to create a wrapped data provider without
further filtering support. This theorethical case is still supported by
using convertFilter with a Void -> F converter.
server/src/main/java/com/vaadin/server/data/AppendableFilterDataProvider.java
server/src/main/java/com/vaadin/server/data/DataProvider.java
server/src/main/java/com/vaadin/server/data/DataProviderWrapper.java
server/src/test/java/com/vaadin/server/data/provider/DataProviderTestBase.java
server/src/test/java/com/vaadin/server/data/provider/ListDataProviderTest.java
server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxFilteringTest.java