DATACMNS-1057 - SingleValueBinding now returns a non-Optional again.

The binding is populated with a value so we can also expect a predicate to be returned.
This commit is contained in:
Oliver Gierke
2017-05-04 23:14:43 +02:00
parent 6894fcb36a
commit 3fb7c870fb
4 changed files with 15 additions and 19 deletions

View File

@@ -357,7 +357,7 @@ public class QuerydslBindings {
public void first(SingleValueBinding<P, T> binding) {
Assert.notNull(binding, "Binding must not be null!");
all((path, value) -> Optionals.next(value.iterator()).flatMap(t -> binding.bind(path, t)));
all((path, value) -> Optionals.next(value.iterator()).map(t -> binding.bind(path, t)));
}
/**
@@ -476,8 +476,7 @@ public class QuerydslBindings {
public <P extends Path<T>> void first(SingleValueBinding<P, T> binding) {
Assert.notNull(binding, "Binding must not be null!");
all((MultiValueBinding<P, T>) (path, value) -> Optionals.next(value.iterator())
.flatMap(t -> binding.bind(path, t)));
all((MultiValueBinding<P, T>) (path, value) -> Optionals.next(value.iterator()).map(t -> binding.bind(path, t)));
}
/**

View File

@@ -15,8 +15,6 @@
*/
package org.springframework.data.querydsl.binding;
import java.util.Optional;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.Predicate;
@@ -40,5 +38,5 @@ public interface SingleValueBinding<T extends Path<? extends S>, S> {
* @return can be {@literal null}, in which case the binding will not be incorporated in the overall {@link Predicate}
* .
*/
Optional<Predicate> bind(T path, S value);
Predicate bind(T path, S value);
}