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:
@@ -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)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user