1 | package com.github.dakusui.pcond.core.fluent.builtins; | |
2 | ||
3 | import com.github.dakusui.pcond.core.fluent.AbstractObjectChecker; | |
4 | import com.github.dakusui.pcond.forms.Predicates; | |
5 | ||
6 | import java.util.function.Function; | |
7 | import java.util.function.Predicate; | |
8 | import java.util.function.Supplier; | |
9 | import java.util.stream.Stream; | |
10 | ||
11 | import static com.github.dakusui.pcond.internals.InternalUtils.trivialIdentityFunction; | |
12 | ||
13 | public interface StreamChecker< | |
14 | T, | |
15 | E> extends | |
16 | AbstractObjectChecker< | |
17 | StreamChecker<T, E>, | |
18 | T, | |
19 | Stream<E>> { | |
20 | default StreamChecker<T, E> noneMatch(Predicate<E> p) { | |
21 |
1
1. noneMatch : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamChecker::noneMatch → KILLED |
return this.checkWithPredicate(Predicates.noneMatch(p)); |
22 | } | |
23 | ||
24 | default StreamChecker<T, E> anyMatch(Predicate<E> p) { | |
25 |
1
1. anyMatch : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamChecker::anyMatch → KILLED |
return this.checkWithPredicate(Predicates.anyMatch(p)); |
26 | } | |
27 | ||
28 | default StreamChecker<T, E> allMatch(Predicate<E> p) { | |
29 |
1
1. allMatch : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamChecker::allMatch → KILLED |
return this.checkWithPredicate(Predicates.allMatch(p)); |
30 | } | |
31 | ||
32 | class Impl< | |
33 | T, | |
34 | E> extends | |
35 | Base< | |
36 | StreamChecker<T, E>, | |
37 | T, | |
38 | Stream<E> | |
39 | > | |
40 | ||
41 | implements StreamChecker<T, E> { | |
42 | public Impl(Supplier<T> rootValue, Function<T, Stream<E>> root) { | |
43 | super(rootValue, root); | |
44 | } | |
45 | ||
46 | @Override | |
47 | protected StreamChecker<Stream<E>, E> rebase() { | |
48 |
1
1. rebase : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamChecker$Impl::rebase → SURVIVED |
return new Impl<>(this::value, trivialIdentityFunction()); |
49 | } | |
50 | } | |
51 | } | |
Mutations | ||
21 |
1.1 |
|
25 |
1.1 |
|
29 |
1.1 |
|
48 |
1.1 |