aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2016-09-19 10:46:20 +0300
committerVaadin Code Review <review@vaadin.com>2016-09-20 06:22:17 +0000
commit53ea4816eedbfa8efd08e28e78d87899581be6e6 (patch)
tree6c471ae99bdc9f92bb201a3ca771ec51841e939f /server
parent7476bdb00fb112eecaf503a9d4f6a33bce5618bf (diff)
downloadvaadin-framework-53ea4816eedbfa8efd08e28e78d87899581be6e6.tar.gz
vaadin-framework-53ea4816eedbfa8efd08e28e78d87899581be6e6.zip
Override forSelect methods for BeanBinder to return narrowed type.
Change-Id: Ib97117d8d0b450edc49309902df535361e901942
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/data/BeanBinder.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/data/BeanBinder.java b/server/src/main/java/com/vaadin/data/BeanBinder.java
index 64436c26a8..21aeb84735 100644
--- a/server/src/main/java/com/vaadin/data/BeanBinder.java
+++ b/server/src/main/java/com/vaadin/data/BeanBinder.java
@@ -21,12 +21,15 @@ import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Objects;
+import java.util.Set;
import java.util.function.Function;
import java.util.function.Predicate;
import com.vaadin.data.util.BeanUtil;
import com.vaadin.data.util.converter.Converter;
import com.vaadin.data.validator.BeanValidator;
+import com.vaadin.ui.AbstractMultiSelect;
+import com.vaadin.ui.AbstractSingleSelect;
/**
* A {@code Binder} subclass specialized for binding <em>beans</em>: classes
@@ -261,6 +264,20 @@ public class BeanBinder<BEAN> extends Binder<BEAN> {
this::handleValidationStatus);
}
+ @Override
+ public <SELECTVALUE> BeanBinding<BEAN, SELECTVALUE, SELECTVALUE> forSelect(
+ AbstractSingleSelect<SELECTVALUE> select) {
+ return (BeanBinding<BEAN, SELECTVALUE, SELECTVALUE>) super.forSelect(
+ select);
+ }
+
+ @Override
+ public <SELECTVALUE> BeanBinding<BEAN, Set<SELECTVALUE>, Set<SELECTVALUE>> forSelect(
+ AbstractMultiSelect<SELECTVALUE> select) {
+ return (BeanBinding<BEAN, Set<SELECTVALUE>, Set<SELECTVALUE>>) super.forSelect(
+ select);
+ }
+
/**
* Binds the given field to the property with the given name. The getter and
* setter methods of the property are looked up with bean introspection and