1 | package com.github.valid8j.pcond.core.printable; | |
2 | ||
3 | import com.github.valid8j.pcond.core.Evaluable; | |
4 | import com.github.valid8j.pcond.core.Evaluator; | |
5 | import com.github.valid8j.pcond.core.identifieable.Identifiable; | |
6 | import com.github.valid8j.pcond.experimentals.currying.context.CurriedContext; | |
7 | import com.github.valid8j.pcond.internals.InternalUtils; | |
8 | import com.github.valid8j.pcond.forms.Predicates; | |
9 | ||
10 | import java.util.*; | |
11 | import java.util.function.BinaryOperator; | |
12 | import java.util.function.Function; | |
13 | import java.util.function.Predicate; | |
14 | import java.util.function.Supplier; | |
15 | import java.util.stream.Stream; | |
16 | ||
17 | import static java.lang.String.format; | |
18 | import static java.util.Arrays.asList; | |
19 | import static java.util.Collections.emptyList; | |
20 | import static java.util.Collections.singletonList; | |
21 | import static java.util.Objects.requireNonNull; | |
22 | import static java.util.stream.Collectors.joining; | |
23 | import static java.util.stream.Collectors.toList; | |
24 | ||
25 | public enum PrintablePredicateFactory { | |
26 | NEGATION, | |
27 | CONJUNCTION, | |
28 | DISJUNCTION, | |
29 | LEAF, | |
30 | ; | |
31 | ||
32 | private static <T> PrintablePredicate<T> toPrintablePredicateIfNotPrintable(Predicate<T> predicate) { | |
33 |
1
1. toPrintablePredicateIfNotPrintable : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::toPrintablePredicateIfNotPrintable → KILLED |
return (PrintablePredicate<T>) toLeafIfNotPrintable(predicate); |
34 | } | |
35 | ||
36 | public static <T> Predicate<T> toLeafIfNotPrintable(Predicate<T> predicate) { | |
37 |
1
1. toLeafIfNotPrintable : negated conditional → KILLED |
if (!(predicate instanceof PrintablePredicate)) |
38 |
1
1. toLeafIfNotPrintable : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::toLeafIfNotPrintable → KILLED |
return leaf(Identifiable.formatObjectName(predicate), predicate); |
39 |
1
1. toLeafIfNotPrintable : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::toLeafIfNotPrintable → KILLED |
return predicate; |
40 | } | |
41 | ||
42 | public static <T> Predicate<T> leaf(String name, Predicate<T> predicate) { | |
43 |
2
1. lambda$leaf$0 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::lambda$leaf$0 → KILLED 2. leaf : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::leaf → KILLED |
return leaf(() -> name, predicate); |
44 | } | |
45 | ||
46 | public static <T> Predicate<T> leaf(Supplier<String> formatter, Predicate<T> predicate) { | |
47 |
1
1. leaf : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::leaf → KILLED |
return leaf(formatter, predicate, PrintablePredicateFactory.class); |
48 | } | |
49 | ||
50 | public static <T> Predicate<T> leaf(Supplier<String> formatter, Predicate<T> predicate, Object fallbackCreator) { | |
51 |
1
1. leaf : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::leaf → KILLED |
return parameterizedLeaf( |
52 |
1
1. lambda$leaf$1 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::lambda$leaf$1 → KILLED |
(args) -> formatter, |
53 |
1
1. lambda$leaf$2 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::lambda$leaf$2 → KILLED |
(args) -> predicate, |
54 | emptyList(), | |
55 | fallbackCreator); | |
56 | } | |
57 | ||
58 | public static <T> Predicate<T> parameterizedLeaf( | |
59 | Function<List<Object>, Supplier<String>> formatterFactory, | |
60 | Function<List<Object>, Predicate<T>> predicateFactory, | |
61 | List<Object> args, | |
62 | Object fallbackCreator | |
63 | ) { | |
64 | Supplier<String> formatter = formatterFactory.apply(args); | |
65 | Predicate<T> predicate = predicateFactory.apply(args); | |
66 |
1
1. parameterizedLeaf : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::parameterizedLeaf → KILLED |
return Identifiable.creatorOf(predicate) |
67 |
1
1. lambda$parameterizedLeaf$3 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::lambda$parameterizedLeaf$3 → KILLED |
.map(c -> new LeafPredicate<>(c, Identifiable.argsOf(predicate), formatter, predicate)) |
68 | .orElse(new LeafPredicate<>(fallbackCreator, args, formatter, predicate)); | |
69 | } | |
70 | ||
71 | public static <P, O> TransformingPredicate.Factory<P, O> transform(Function<O, P> function) { | |
72 |
1
1. transform : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::transform → KILLED |
return TransformingPredicate.Factory.create(function); |
73 | } | |
74 | ||
75 | public static <T> Conjunction<T> and(List<Predicate<? super T>> predicates) { | |
76 |
1
1. and : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::and → KILLED |
return new Conjunction<T>(predicates, true); |
77 | } | |
78 | ||
79 | public static <T> Disjunction<T> or(List<Predicate<? super T>> predicates) { | |
80 |
1
1. or : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::or → KILLED |
return new Disjunction<T>(predicates, true); |
81 | } | |
82 | ||
83 | public static <T> Conjunction<T> allOf(List<Predicate<? super T>> predicates) { | |
84 |
1
1. allOf : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::allOf → KILLED |
return new Conjunction<T>(predicates, false); |
85 | } | |
86 | ||
87 | public static <T> Disjunction<T> anyOf(List<Predicate<? super T>> predicates) { | |
88 |
1
1. anyOf : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::anyOf → KILLED |
return new Disjunction<T>(predicates, false); |
89 | } | |
90 | ||
91 | public static <T> Predicate<T> not(Predicate<T> predicate) { | |
92 |
1
1. not : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::not → KILLED |
return not_(predicate); |
93 | } | |
94 | ||
95 | @SuppressWarnings("ClassEscapesDefinedScope") | |
96 | public static <T> Negation<T> not_(Predicate<T> predicate) { | |
97 |
1
1. not_ : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::not_ → KILLED |
return new Negation<T>(toPrintablePredicateIfNotPrintable(predicate), singletonList(predicate)); |
98 | } | |
99 | ||
100 | public static <E> Predicate<Stream<E>> allMatch(Predicate<E> predicate) { | |
101 |
1
1. allMatch : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::allMatch → KILLED |
return AllMatch.create(predicate); |
102 | } | |
103 | ||
104 | public static <E> Predicate<Stream<E>> noneMatch(Predicate<E> predicate) { | |
105 |
1
1. noneMatch : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::noneMatch → KILLED |
return NoneMatch.create(predicate); |
106 | } | |
107 | ||
108 | public static <E> Predicate<Stream<E>> anyMatch(Predicate<E> predicate) { | |
109 |
1
1. anyMatch : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::anyMatch → KILLED |
return AnyMatch.create(predicate); |
110 | } | |
111 | ||
112 | public static <T> Predicate<CurriedContext> variableBundlePredicate(Predicate<T> predicate, int argIndex) { | |
113 |
1
1. variableBundlePredicate : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory::variableBundlePredicate → KILLED |
return CurriedContextPredicate.create(toPrintablePredicateIfNotPrintable(predicate), argIndex); |
114 | } | |
115 | ||
116 | private static RuntimeException noPredicateGiven() { | |
117 | throw new IllegalArgumentException("No predicate was given"); | |
118 | } | |
119 | ||
120 | /* | |
121 | Expected: "100 -> && -> false" | |
122 | but: was "100 -> && -> false" | |
123 | */ | |
124 | public enum Leaf { | |
125 |
1
1. lambda$static$0 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$0 → KILLED |
ALWAYS_TRUE("alwaysTrue", v -> true), |
126 |
2
1. lambda$static$1 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$1 → KILLED 2. lambda$static$1 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$1 → KILLED |
IS_TRUE("isTrue", (Boolean v) -> v), |
127 |
2
1. lambda$static$2 : negated conditional → KILLED 2. lambda$static$2 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$2 → KILLED |
IS_FALSE("isFalse", (Boolean v) -> !v), |
128 | IS_NULL("isNull", Objects::isNull), | |
129 | IS_NOT_NULL("isNotNull", Objects::nonNull), | |
130 |
2
1. lambda$static$3 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$3 → KILLED 2. lambda$static$3 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$3 → KILLED |
IS_EMPTY_STRING("isEmpty", v -> ((String) v).isEmpty()), |
131 |
3
1. lambda$static$4 : negated conditional → KILLED 2. lambda$static$4 : negated conditional → KILLED 3. lambda$static$4 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$4 → KILLED |
IS_NULL_OR_EMPTY_STRING("isNullOrEmptyString", v -> v == null || ((String) v).isEmpty()), |
132 |
2
1. lambda$static$5 : negated conditional → KILLED 2. lambda$static$5 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$5 → KILLED |
IS_EMPTY_ARRAY("isEmptyArray", objects -> ((Object[]) objects).length == 0), |
133 |
2
1. lambda$static$6 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$6 → KILLED 2. lambda$static$6 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$static$6 → KILLED |
IS_EMPTY_COLLECTION("isEmpty", v -> ((Collection<?>) v).isEmpty()), |
134 | ; | |
135 | final Predicate<?> instance; | |
136 | ||
137 | @SuppressWarnings("unchecked") | |
138 | Leaf(String s, Predicate<?> predicate) { | |
139 |
1
1. lambda$new$7 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::lambda$new$7 → KILLED |
this.instance = leaf(() -> s, (Predicate<? super Object>) predicate, this); |
140 | } | |
141 | ||
142 | @SuppressWarnings("unchecked") | |
143 | public <T> Predicate<T> instance() { | |
144 |
1
1. instance : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Leaf::instance → KILLED |
return (Predicate<T>) this.instance; |
145 | } | |
146 | } | |
147 | ||
148 | public enum ParameterizedLeafFactory { | |
149 | IS_EQUAL_TO( | |
150 |
2
1. lambda$null$0 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$0 → KILLED 2. lambda$static$1 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$1 → KILLED |
(args) -> () -> format("isEqualTo[%s]", args.get(0)), |
151 |
3
1. lambda$null$2 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$2 → KILLED 2. lambda$null$2 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$2 → KILLED 3. lambda$static$3 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$3 → KILLED |
(args) -> v -> Objects.equals(v, args.get(0))), |
152 | @SuppressWarnings("unchecked") GREATER_THAN( | |
153 |
2
1. lambda$null$4 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$4 → KILLED 2. lambda$static$5 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$5 → KILLED |
(args) -> () -> format(">[%s]", args.get(0)), |
154 |
4
1. lambda$null$6 : changed conditional boundary → KILLED 2. lambda$null$6 : negated conditional → KILLED 3. lambda$null$6 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$6 → KILLED 4. lambda$static$7 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$7 → KILLED |
(args) -> v -> ((Comparable<? super Comparable<?>>) v).compareTo((Comparable<? super Comparable<?>>) args.get(0)) > 0), |
155 | @SuppressWarnings("unchecked") GREATER_THAN_OR_EQUAL_TO( | |
156 |
2
1. lambda$null$8 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$8 → KILLED 2. lambda$static$9 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$9 → KILLED |
(args) -> () -> format(">=[%s]", args.get(0)), |
157 |
4
1. lambda$null$10 : changed conditional boundary → KILLED 2. lambda$null$10 : negated conditional → KILLED 3. lambda$null$10 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$10 → KILLED 4. lambda$static$11 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$11 → KILLED |
(args) -> v -> ((Comparable<? super Comparable<?>>) v).compareTo((Comparable<? super Comparable<?>>) args.get(0)) >= 0), |
158 | @SuppressWarnings("unchecked") LESS_THAN_OR_EQUAL_TO( | |
159 |
2
1. lambda$null$12 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$12 → KILLED 2. lambda$static$13 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$13 → KILLED |
(args) -> () -> format("<=[%s]", args.get(0)), |
160 |
4
1. lambda$null$14 : changed conditional boundary → KILLED 2. lambda$null$14 : negated conditional → KILLED 3. lambda$null$14 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$14 → KILLED 4. lambda$static$15 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$15 → KILLED |
(args) -> v -> ((Comparable<? super Comparable<?>>) v).compareTo((Comparable<? super Comparable<?>>) args.get(0)) <= 0), |
161 | @SuppressWarnings("unchecked") LESS_THAN( | |
162 |
2
1. lambda$null$16 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$16 → KILLED 2. lambda$static$17 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$17 → KILLED |
(args) -> () -> format("<[%s]", args.get(0)), |
163 |
4
1. lambda$null$18 : changed conditional boundary → KILLED 2. lambda$null$18 : negated conditional → KILLED 3. lambda$null$18 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$18 → KILLED 4. lambda$static$19 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$19 → KILLED |
(args) -> v -> ((Comparable<? super Comparable<?>>) v).compareTo((Comparable<? super Comparable<?>>) args.get(0)) < 0), |
164 | @SuppressWarnings("unchecked") EQUAL_TO( | |
165 |
2
1. lambda$null$20 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$20 → KILLED 2. lambda$static$21 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$21 → KILLED |
(args) -> () -> format("=[%s]", args.get(0)), |
166 |
3
1. lambda$null$22 : negated conditional → KILLED 2. lambda$null$22 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$22 → KILLED 3. lambda$static$23 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$23 → KILLED |
(args) -> v -> ((Comparable<? super Comparable<?>>) v).compareTo((Comparable<? super Comparable<?>>) args.get(0)) == 0), |
167 | MATCHES_REGEX( | |
168 |
2
1. lambda$null$24 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$24 → KILLED 2. lambda$static$25 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$25 → KILLED |
(args) -> () -> String.format("matchesRegex[%s]", args.get(0)), |
169 |
3
1. lambda$null$26 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$26 → KILLED 2. lambda$null$26 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$26 → KILLED 3. lambda$static$27 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$27 → KILLED |
(args) -> (s) -> ((String) s).matches((String) args.get(0))), |
170 | CONTAINS_STRING( | |
171 |
2
1. lambda$null$28 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$28 → KILLED 2. lambda$static$29 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$29 → KILLED |
(args) -> () -> format("containsString[%s]", args.get(0)), |
172 |
3
1. lambda$null$30 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$30 → KILLED 2. lambda$null$30 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$30 → KILLED 3. lambda$static$31 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$31 → KILLED |
(args) -> (s) -> ((String) s).contains((String) args.get(0))), |
173 | STARTS_WITH( | |
174 |
2
1. lambda$null$32 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$32 → KILLED 2. lambda$static$33 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$33 → KILLED |
(args) -> () -> format("startsWith[%s]", args.get(0)), |
175 |
3
1. lambda$null$34 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$34 → KILLED 2. lambda$null$34 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$34 → KILLED 3. lambda$static$35 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$35 → KILLED |
(args) -> (s) -> ((String) s).startsWith((String) args.get(0))), |
176 | ENDS_WITH( | |
177 |
2
1. lambda$null$36 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$36 → KILLED 2. lambda$static$37 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$37 → KILLED |
(args) -> () -> format("endsWith[%s]", args.get(0)), |
178 |
3
1. lambda$null$38 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$38 → KILLED 2. lambda$null$38 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$38 → KILLED 3. lambda$static$39 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$39 → KILLED |
(args) -> (s) -> ((String) s).endsWith((String) args.get(0))), |
179 | EQUALS_IGNORE_CASE( | |
180 |
2
1. lambda$null$40 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$40 → KILLED 2. lambda$static$41 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$41 → KILLED |
(args) -> () -> format("equalsIgnoreCase[%s]", args.get(0)), |
181 |
1
1. lambda$static$43 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$43 → KILLED |
(args) -> (s) -> { |
182 |
2
1. lambda$null$42 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$42 → KILLED 2. lambda$null$42 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$42 → KILLED |
return ((String) s).equalsIgnoreCase((String) args.get(0)); |
183 | }), | |
184 | OBJECT_IS_SAME_AS( | |
185 |
2
1. lambda$null$44 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$44 → KILLED 2. lambda$static$45 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$45 → KILLED |
arg -> () -> format("==[%s]", arg.get(0)), |
186 |
3
1. lambda$null$46 : negated conditional → KILLED 2. lambda$null$46 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$46 → KILLED 3. lambda$static$47 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$47 → KILLED |
args -> v -> v == args.get(0)), |
187 | CONTAINS( | |
188 |
2
1. lambda$null$48 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$48 → KILLED 2. lambda$static$49 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$49 → KILLED |
(args) -> () -> format("contains[%s]", args.get(0)), |
189 |
3
1. lambda$null$50 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$50 → KILLED 2. lambda$null$50 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$null$50 → KILLED 3. lambda$static$51 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::lambda$static$51 → KILLED |
(args) -> (c) -> ((Collection<?>) c).contains(args.get(0))); |
190 | private final Function<List<Object>, Predicate<Object>> predicateFactory; | |
191 | private final Function<List<Object>, Supplier<String>> formatterFactory; | |
192 | ||
193 | ParameterizedLeafFactory(Function<List<Object>, Supplier<String>> formatterFactory, Function<List<Object>, Predicate<Object>> predicateFactory) { | |
194 | this.predicateFactory = predicateFactory; | |
195 | this.formatterFactory = formatterFactory; | |
196 | } | |
197 | ||
198 | Function<List<Object>, Supplier<String>> formatterFactory() { | |
199 |
1
1. formatterFactory : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::formatterFactory → KILLED |
return this.formatterFactory; |
200 | } | |
201 | ||
202 | @SuppressWarnings({ "unchecked", "rawtypes" }) | |
203 | <T> Function<List<Object>, Predicate<T>> functionFactory() { | |
204 |
1
1. functionFactory : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::functionFactory → KILLED |
return (Function) this.predicateFactory; |
205 | } | |
206 | ||
207 | public static <T> Predicate<T> create(ParameterizedLeafFactory parameterizedLeafFactory, List<Object> args) { | |
208 |
1
1. create : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$ParameterizedLeafFactory::create → KILLED |
return parameterizedLeaf( |
209 | parameterizedLeafFactory.formatterFactory(), parameterizedLeafFactory.functionFactory(), args, parameterizedLeafFactory | |
210 | ); | |
211 | } | |
212 | } | |
213 | ||
214 | private static class LeafPredicate<T> extends PrintablePredicate<T> implements Evaluable.LeafPred<T>, Evaluator.Explainable { | |
215 | protected LeafPredicate(Object creator, List<Object> args, Supplier<String> formatter, Predicate<? super T> predicate) { | |
216 | super(creator, args, formatter, predicate); | |
217 | } | |
218 | ||
219 | @Override | |
220 | public Predicate<? super T> predicate() { | |
221 |
1
1. predicate : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$LeafPredicate::predicate → KILLED |
return predicate; |
222 | } | |
223 | ||
224 | @Override | |
225 | public Object explainOutputExpectation() { | |
226 |
1
1. explainOutputExpectation : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$LeafPredicate::explainOutputExpectation → KILLED |
return this.formatter.get(); |
227 | } | |
228 | ||
229 | @Override | |
230 | public Object explainActual(Object actualValue) { | |
231 |
1
1. explainActual : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$LeafPredicate::explainActual → SURVIVED |
return actualValue; |
232 | } | |
233 | ||
234 | @Override | |
235 | public String toString() { | |
236 |
1
1. toString : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$LeafPredicate::toString → KILLED |
return InternalUtils.formatObject(InternalUtils.toNonStringObject(this.formatter.get())); |
237 | } | |
238 | } | |
239 | ||
240 | static class Negation<T> extends PrintablePredicate<T> implements Evaluable.Negation<T> { | |
241 | final Evaluable<T> target; | |
242 | ||
243 | @SuppressWarnings("unchecked") | |
244 | protected Negation(Predicate<T> predicate, List<Object> args) { | |
245 | super( | |
246 | NEGATION, | |
247 | args, | |
248 |
1
1. lambda$new$0 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Negation::lambda$new$0 → KILLED |
() -> format("!%s", predicate), |
249 |
2
1. lambda$new$1 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Negation::lambda$new$1 → KILLED 2. lambda$new$1 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Negation::lambda$new$1 → KILLED |
(t) -> PrintablePredicate.unwrap((Predicate<Object>) predicate).negate().test(t)); |
250 | this.target = (Evaluable<T>) InternalUtils.toEvaluableIfNecessary(predicate); | |
251 | this.squashable = true; | |
252 | } | |
253 | ||
254 | @Override | |
255 | public Evaluable<T> target() { | |
256 |
1
1. target : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Negation::target → KILLED |
return target; |
257 | } | |
258 | } | |
259 | ||
260 | public static class Conjunction<T> extends Junction<T> implements Evaluable.Conjunction<T> { | |
261 | protected Conjunction(List<Predicate<? super T>> predicates, boolean shortcut) { | |
262 | super( | |
263 | predicates, | |
264 | CONJUNCTION, | |
265 | "&&", | |
266 | Predicate::and, | |
267 | shortcut); | |
268 | } | |
269 | } | |
270 | ||
271 | public static class Disjunction<T> extends Junction<T> implements Evaluable.Disjunction<T> { | |
272 | protected Disjunction(List<Predicate<? super T>> predicates, boolean shortcut) { | |
273 | super( | |
274 | predicates, | |
275 | DISJUNCTION, | |
276 | "||", | |
277 | Predicate::or, | |
278 | shortcut); | |
279 | } | |
280 | } | |
281 | ||
282 | abstract static class Junction<T> extends PrintablePredicate<T> implements Evaluable.Composite<T> { | |
283 | final List<Evaluable<T>> children; | |
284 | final private boolean shortcut; | |
285 | ||
286 | @SuppressWarnings("unchecked") | |
287 | protected Junction( | |
288 | List<Predicate<? super T>> predicates, | |
289 | PrintablePredicateFactory creator, | |
290 | String junctionSymbol, | |
291 | BinaryOperator<Predicate<T>> junctionOp, boolean shortcut) { | |
292 | super( | |
293 | creator, | |
294 | new ArrayList<>(predicates), | |
295 |
1
1. lambda$new$0 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::lambda$new$0 → KILLED |
() -> formatJunction(predicates, junctionSymbol), |
296 | junction(predicates, junctionOp)); | |
297 | this.children = predicates.stream() | |
298 | .map(InternalUtils::toEvaluableIfNecessary) | |
299 |
1
1. lambda$new$1 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::lambda$new$1 → KILLED |
.map(each -> (Evaluable<T>) each) |
300 | .collect(toList()); | |
301 | this.shortcut = shortcut; | |
302 | } | |
303 | ||
304 | @Override | |
305 | public List<Evaluable<T>> children() { | |
306 |
1
1. children : replaced return value with Collections.emptyList for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::children → KILLED |
return this.children; |
307 | } | |
308 | ||
309 | @Override | |
310 | public boolean shortcut() { | |
311 |
2
1. shortcut : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::shortcut → KILLED 2. shortcut : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::shortcut → KILLED |
return this.shortcut; |
312 | } | |
313 | ||
314 | public List<Predicate<T>> childPredicates() { | |
315 |
1
1. childPredicates : replaced return value with Collections.emptyList for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::childPredicates → NO_COVERAGE |
return childrenOfJunction(this); |
316 | } | |
317 | ||
318 | static <T> String formatJunction(List<Predicate<? super T>> predicates, String junctionSymbol) { | |
319 |
1
1. formatJunction : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::formatJunction → KILLED |
return predicates.stream() |
320 |
1
1. lambda$formatJunction$2 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::lambda$formatJunction$2 → KILLED |
.map(PrintablePredicateFactory::toPrintablePredicateIfNotPrintable) |
321 | .map(Object::toString) | |
322 | .collect(joining(junctionSymbol, "(", ")")); | |
323 | } | |
324 | ||
325 | @SuppressWarnings("unchecked") | |
326 | static <T> Predicate<T> junction(List<Predicate<? super T>> predicates_, BinaryOperator<Predicate<T>> junctionOp) { | |
327 |
1
1. junction : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::junction → KILLED |
return predicates_ |
328 | .stream() | |
329 | .map(PrintablePredicate::unwrap) | |
330 |
1
1. lambda$junction$3 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::lambda$junction$3 → KILLED |
.map(p -> (Predicate<T>) p) |
331 | .reduce(junctionOp) | |
332 |
1
1. lambda$junction$4 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::lambda$junction$4 → NO_COVERAGE |
.orElseThrow(PrintablePredicateFactory::noPredicateGiven); |
333 | } | |
334 | ||
335 | static <T> List<Predicate<T>> childrenOfJunction(Junction<T> junction) { | |
336 |
1
1. childrenOfJunction : replaced return value with Collections.emptyList for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::childrenOfJunction → NO_COVERAGE |
return evaluablesToPredicates(junction.children); |
337 | } | |
338 | ||
339 | @SuppressWarnings("unchecked") | |
340 | private static <T> List<Predicate<T>> evaluablesToPredicates(List<Evaluable<T>> evaluables) { | |
341 |
1
1. evaluablesToPredicates : replaced return value with Collections.emptyList for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::evaluablesToPredicates → NO_COVERAGE |
return evaluables.stream() |
342 | .peek(each -> { | |
343 | assert each instanceof Predicate; | |
344 | }) | |
345 |
1
1. lambda$evaluablesToPredicates$6 : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$Junction::lambda$evaluablesToPredicates$6 → NO_COVERAGE |
.map(each -> (Predicate<T>) each) |
346 | .collect(toList()); | |
347 | } | |
348 | } | |
349 | ||
350 | /** | |
351 | * This is an interface that corresponds to a "matcher" in other assertion | |
352 | * libraries. | |
353 | */ | |
354 | public static class TransformingPredicate<T, R> extends PrintablePredicate<T> implements Evaluable.Transformation<T, R> { | |
355 | private final Evaluable<? super T> mapper; | |
356 | private final Evaluable<? super R> checker; | |
357 | private final String mapperName; | |
358 | private final String checkerName; | |
359 | ||
360 | @SuppressWarnings("unchecked") | |
361 | public TransformingPredicate(String mapperName, String checkerName, Predicate<? super R> predicate, Function<? super T, ? extends R> function) { | |
362 | super( | |
363 | TransformingPredicate.class, | |
364 | asList(predicate, function), | |
365 |
3
1. lambda$new$0 : negated conditional → KILLED 2. lambda$new$0 : negated conditional → KILLED 3. lambda$new$0 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate::lambda$new$0 → KILLED |
() -> mapperName == null ? |
366 |
1
1. lambda$new$0 : negated conditional → KILLED |
format("%s %s", function, checkerName == null ? predicate : (checkerName + ":" + predicate.toString())) : |
367 | format("%s(%s %s)", mapperName, function, checkerName == null ? predicate : checkerName + ":" + predicate.toString()), | |
368 |
2
1. lambda$new$1 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate::lambda$new$1 → KILLED 2. lambda$new$1 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate::lambda$new$1 → KILLED |
v -> predicate.test(function.apply(v))); |
369 | this.mapper = (Evaluable<? super T>) InternalUtils.toEvaluableIfNecessary(function); | |
370 | this.mapperName = mapperName; | |
371 | this.checker = (Evaluable<? super R>) InternalUtils.toEvaluableIfNecessary(predicate); | |
372 | this.checkerName = checkerName; | |
373 | this.squashable = true; | |
374 | } | |
375 | ||
376 | @SuppressWarnings("unchecked") | |
377 | @Override | |
378 | public Evaluable<T> mapper() { | |
379 |
1
1. mapper : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate::mapper → KILLED |
return (Evaluable<T>) this.mapper; |
380 | } | |
381 | ||
382 | @SuppressWarnings("unchecked") | |
383 | @Override | |
384 | public Evaluable<R> checker() { | |
385 |
1
1. checker : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate::checker → KILLED |
return (Evaluable<R>) this.checker; |
386 | } | |
387 | ||
388 | @Override | |
389 | public Optional<String> mapperName() { | |
390 |
1
1. mapperName : replaced return value with Optional.empty for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate::mapperName → SURVIVED |
return Optional.ofNullable(this.mapperName); |
391 | } | |
392 | ||
393 | @Override | |
394 | public Optional<String> checkerName() { | |
395 |
1
1. checkerName : replaced return value with Optional.empty for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate::checkerName → KILLED |
return Optional.ofNullable(this.checkerName); |
396 | } | |
397 | ||
398 | /** | |
399 | * This is an interface that corresponds to a "matcher" in other assertion | |
400 | * libraries. | |
401 | * | |
402 | * @param <P> Intermediate parameter type tested by a predicated. | |
403 | * @param <O> Input parameter type. | |
404 | */ | |
405 | public static abstract class Factory<P, O> { | |
406 | public abstract Predicate<O> check(String condName, Predicate<? super P> cond); | |
407 | ||
408 | @SuppressWarnings("unchecked") | |
409 | public <OO> Factory<P, OO> castTo(@SuppressWarnings("unused") Class<OO> ooClass) { | |
410 |
1
1. castTo : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate$Factory::castTo → KILLED |
return (Factory<P, OO>) this; |
411 | } | |
412 | ||
413 | public abstract Predicate<O> check(Predicate<? super P> cond); | |
414 | ||
415 | @SafeVarargs | |
416 | public final Predicate<O> checkAllOf(Predicate<? super P>... conds) { | |
417 |
1
1. checkAllOf : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate$Factory::checkAllOf → NO_COVERAGE |
return check(Predicates.allOf(conds)); |
418 | } | |
419 | @SafeVarargs | |
420 | public final Predicate<O> allOf(Predicate<? super P>... conds) { | |
421 |
1
1. allOf : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate$Factory::allOf → NO_COVERAGE |
return checkAllOf(conds); |
422 | } | |
423 | ||
424 | public static <P, O> Factory<P, O> create(Function<O, P> function) { | |
425 |
1
1. create : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate$Factory::create → KILLED |
return create(null, null, function); |
426 | } | |
427 | ||
428 | public static <P, O> Factory<P, O> create(String mapperName, String checkerName, Function<O, P> function) { | |
429 |
1
1. create : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate$Factory::create → KILLED |
return new Factory<P, O>() { |
430 | @Override | |
431 | public Predicate<O> check(String condName, Predicate<? super P> cond) { | |
432 |
1
1. check : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate$Factory$1::check → KILLED |
return new TransformingPredicate<>(mapperName, condName, cond, function); |
433 | } | |
434 | ||
435 | @Override | |
436 | public Predicate<O> check(Predicate<? super P> cond) { | |
437 |
1
1. check : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$TransformingPredicate$Factory$1::check → KILLED |
return new TransformingPredicate<>(mapperName, checkerName, toPrintablePredicateIfNotPrintable(cond), function); |
438 | } | |
439 | }; | |
440 | } | |
441 | } | |
442 | } | |
443 | ||
444 | static class CurriedContextPredicate extends PrintablePredicate<CurriedContext> implements Evaluable.CurriedContextPred { | |
445 | private final Evaluable<?> enclosed; | |
446 | private final int argIndex; | |
447 | ||
448 | private <T> CurriedContextPredicate(Object creator, List<Object> args, Predicate<T> predicate, int argIndex) { | |
449 | super( | |
450 | creator, | |
451 | args, | |
452 |
1
1. lambda$new$0 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$CurriedContextPredicate::lambda$new$0 → KILLED |
() -> format("curry[%s,%s]", predicate, argIndex), |
453 |
2
1. lambda$new$1 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$CurriedContextPredicate::lambda$new$1 → KILLED 2. lambda$new$1 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$CurriedContextPredicate::lambda$new$1 → KILLED |
context -> PrintablePredicate.unwrap(predicate).test(context.valueAt(argIndex))); |
454 | this.enclosed = (Evaluable<?>) InternalUtils.toEvaluableIfNecessary(predicate); | |
455 | this.argIndex = argIndex; | |
456 | ||
457 | } | |
458 | ||
459 | @SuppressWarnings("unchecked") | |
460 | @Override | |
461 | public <TT> Evaluable<TT> enclosed() { | |
462 |
1
1. enclosed : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$CurriedContextPredicate::enclosed → KILLED |
return (Evaluable<TT>) this.enclosed; |
463 | } | |
464 | ||
465 | @Override | |
466 | public int argIndex() { | |
467 |
1
1. argIndex : replaced int return with 0 for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$CurriedContextPredicate::argIndex → KILLED |
return argIndex; |
468 | } | |
469 | ||
470 | public static <T> CurriedContextPredicate create(Predicate<T> predicate, int argIndex) { | |
471 |
1
1. create : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$CurriedContextPredicate::create → KILLED |
return new CurriedContextPredicate(CurriedContextPredicate.class, asList(predicate, argIndex), predicate, argIndex); |
472 | } | |
473 | } | |
474 | ||
475 | static class AllMatch<E> extends StreamPredicate<E> { | |
476 | @SuppressWarnings("unchecked") | |
477 | private AllMatch(Predicate<? super E> predicate) { | |
478 | super( | |
479 | AllMatch.class, | |
480 | singletonList(predicate), | |
481 |
1
1. lambda$new$0 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$AllMatch::lambda$new$0 → KILLED |
() -> format("allMatch[%s]", predicate), |
482 |
2
1. lambda$new$1 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$AllMatch::lambda$new$1 → KILLED 2. lambda$new$1 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$AllMatch::lambda$new$1 → KILLED |
(Stream<E> stream) -> stream.allMatch(predicate), |
483 | InternalUtils.toEvaluableIfNecessary((Predicate<? super Stream<? extends E>>) predicate), | |
484 | true, | |
485 | false); | |
486 | } | |
487 | ||
488 | static <E> StreamPredicate<E> create(Predicate<? super E> predicate) { | |
489 |
1
1. create : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$AllMatch::create → KILLED |
return new AllMatch<>( |
490 | predicate | |
491 | ); | |
492 | } | |
493 | } | |
494 | ||
495 | static class AnyMatch<E> extends StreamPredicate<E> { | |
496 | @SuppressWarnings("unchecked") | |
497 | private AnyMatch(Predicate<? super E> predicate) { | |
498 | super( | |
499 | AnyMatch.class, | |
500 | singletonList(predicate), | |
501 |
1
1. lambda$new$0 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$AnyMatch::lambda$new$0 → KILLED |
() -> format("anyMatch[%s]", predicate), |
502 |
2
1. lambda$new$1 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$AnyMatch::lambda$new$1 → KILLED 2. lambda$new$1 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$AnyMatch::lambda$new$1 → KILLED |
(Stream<E> stream) -> stream.anyMatch(PrintablePredicate.unwrap(predicate)), |
503 | (Evaluable<Stream<E>>) InternalUtils.toEvaluableIfNecessary(predicate), | |
504 | false, | |
505 | true); | |
506 | } | |
507 | ||
508 | public static <E> StreamPredicate<E> create(Predicate<? super E> predicate) { | |
509 |
1
1. create : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$AnyMatch::create → KILLED |
return new AnyMatch<>( |
510 | predicate | |
511 | ); | |
512 | } | |
513 | } | |
514 | ||
515 | static class NoneMatch<E> extends StreamPredicate<E> { | |
516 | @SuppressWarnings("unchecked") | |
517 | private NoneMatch(Predicate<? super E> predicate) { | |
518 | super( | |
519 | NoneMatch.class, | |
520 | singletonList(predicate), | |
521 |
1
1. lambda$new$0 : replaced return value with "" for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$NoneMatch::lambda$new$0 → KILLED |
() -> format("noneMatch[%s]", predicate), |
522 |
2
1. lambda$new$1 : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$NoneMatch::lambda$new$1 → KILLED 2. lambda$new$1 : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$NoneMatch::lambda$new$1 → KILLED |
(Stream<E> stream) -> stream.noneMatch(predicate), |
523 | (Evaluable<Stream<E>>) InternalUtils.toEvaluableIfNecessary((Predicate<? super Stream<E>>) predicate), | |
524 | true, | |
525 | true); | |
526 | } | |
527 | ||
528 | @Override | |
529 | public boolean requestExpectationFlip() { | |
530 |
1
1. requestExpectationFlip : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$NoneMatch::requestExpectationFlip → KILLED |
return true; |
531 | } | |
532 | ||
533 | public static <E> StreamPredicate<E> create(Predicate<E> predicate) { | |
534 |
1
1. create : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$NoneMatch::create → KILLED |
return new NoneMatch<E>( |
535 | predicate | |
536 | ) { | |
537 | }; | |
538 | } | |
539 | } | |
540 | ||
541 | public abstract static class StreamPredicate<E> extends PrintablePredicate<Stream<E>> implements Evaluable.StreamPred<E> { | |
542 | private final Evaluable<Stream<E>> cut; | |
543 | private final boolean defaultValue; | |
544 | private final boolean cutOn; | |
545 | ||
546 | private StreamPredicate(Object creator, List<Object> args, Supplier<String> formatter, Predicate<Stream<E>> predicate, Evaluable<Stream<E>> cut, boolean defaultValue, boolean cutOn) { | |
547 | super(creator, args, formatter, predicate); | |
548 | this.cut = requireNonNull(cut); | |
549 | this.defaultValue = defaultValue; | |
550 | this.cutOn = cutOn; | |
551 | } | |
552 | ||
553 | @Override | |
554 | public boolean defaultValue() { | |
555 |
2
1. defaultValue : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$StreamPredicate::defaultValue → KILLED 2. defaultValue : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$StreamPredicate::defaultValue → KILLED |
return defaultValue; |
556 | } | |
557 | ||
558 | @SuppressWarnings("unchecked") | |
559 | @Override | |
560 | public Evaluable<E> cut() { | |
561 |
1
1. cut : replaced return value with null for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$StreamPredicate::cut → KILLED |
return (Evaluable<E>) this.cut; |
562 | } | |
563 | ||
564 | @Override | |
565 | public boolean valueToCut() { | |
566 |
2
1. valueToCut : replaced boolean return with false for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$StreamPredicate::valueToCut → KILLED 2. valueToCut : replaced boolean return with true for com/github/valid8j/pcond/core/printable/PrintablePredicateFactory$StreamPredicate::valueToCut → KILLED |
return cutOn; |
567 | } | |
568 | } | |
569 | } | |
Mutations | ||
33 |
1.1 |
|
37 |
1.1 |
|
38 |
1.1 |
|
39 |
1.1 |
|
43 |
1.1 2.2 |
|
47 |
1.1 |
|
51 |
1.1 |
|
52 |
1.1 |
|
53 |
1.1 |
|
66 |
1.1 |
|
67 |
1.1 |
|
72 |
1.1 |
|
76 |
1.1 |
|
80 |
1.1 |
|
84 |
1.1 |
|
88 |
1.1 |
|
92 |
1.1 |
|
97 |
1.1 |
|
101 |
1.1 |
|
105 |
1.1 |
|
109 |
1.1 |
|
113 |
1.1 |
|
125 |
1.1 |
|
126 |
1.1 2.2 |
|
127 |
1.1 2.2 |
|
130 |
1.1 2.2 |
|
131 |
1.1 2.2 3.3 |
|
132 |
1.1 2.2 |
|
133 |
1.1 2.2 |
|
139 |
1.1 |
|
144 |
1.1 |
|
150 |
1.1 2.2 |
|
151 |
1.1 2.2 3.3 |
|
153 |
1.1 2.2 |
|
154 |
1.1 2.2 3.3 4.4 |
|
156 |
1.1 2.2 |
|
157 |
1.1 2.2 3.3 4.4 |
|
159 |
1.1 2.2 |
|
160 |
1.1 2.2 3.3 4.4 |
|
162 |
1.1 2.2 |
|
163 |
1.1 2.2 3.3 4.4 |
|
165 |
1.1 2.2 |
|
166 |
1.1 2.2 3.3 |
|
168 |
1.1 2.2 |
|
169 |
1.1 2.2 3.3 |
|
171 |
1.1 2.2 |
|
172 |
1.1 2.2 3.3 |
|
174 |
1.1 2.2 |
|
175 |
1.1 2.2 3.3 |
|
177 |
1.1 2.2 |
|
178 |
1.1 2.2 3.3 |
|
180 |
1.1 2.2 |
|
181 |
1.1 |
|
182 |
1.1 2.2 |
|
185 |
1.1 2.2 |
|
186 |
1.1 2.2 3.3 |
|
188 |
1.1 2.2 |
|
189 |
1.1 2.2 3.3 |
|
199 |
1.1 |
|
204 |
1.1 |
|
208 |
1.1 |
|
221 |
1.1 |
|
226 |
1.1 |
|
231 |
1.1 |
|
236 |
1.1 |
|
248 |
1.1 |
|
249 |
1.1 2.2 |
|
256 |
1.1 |
|
295 |
1.1 |
|
299 |
1.1 |
|
306 |
1.1 |
|
311 |
1.1 2.2 |
|
315 |
1.1 |
|
319 |
1.1 |
|
320 |
1.1 |
|
327 |
1.1 |
|
330 |
1.1 |
|
332 |
1.1 |
|
336 |
1.1 |
|
341 |
1.1 |
|
345 |
1.1 |
|
365 |
1.1 2.2 3.3 |
|
366 |
1.1 |
|
368 |
1.1 2.2 |
|
379 |
1.1 |
|
385 |
1.1 |
|
390 |
1.1 |
|
395 |
1.1 |
|
410 |
1.1 |
|
417 |
1.1 |
|
421 |
1.1 |
|
425 |
1.1 |
|
429 |
1.1 |
|
432 |
1.1 |
|
437 |
1.1 |
|
452 |
1.1 |
|
453 |
1.1 2.2 |
|
462 |
1.1 |
|
467 |
1.1 |
|
471 |
1.1 |
|
481 |
1.1 |
|
482 |
1.1 2.2 |
|
489 |
1.1 |
|
501 |
1.1 |
|
502 |
1.1 2.2 |
|
509 |
1.1 |
|
521 |
1.1 |
|
522 |
1.1 2.2 |
|
530 |
1.1 |
|
534 |
1.1 |
|
555 |
1.1 2.2 |
|
561 |
1.1 |
|
566 |
1.1 2.2 |