| 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 | ||
| 10 | import static com.github.dakusui.pcond.internals.InternalUtils.trivialIdentityFunction; | |
| 11 | import static java.util.Objects.requireNonNull; | |
| 12 | ||
| 13 | public interface BooleanChecker<T> extends | |
| 14 | AbstractObjectChecker< | |
| 15 | BooleanChecker<T>, | |
| 16 | T, | |
| 17 | Boolean> { | |
| 18 | ||
| 19 | default BooleanChecker<T> isTrue() { | |
| 20 |
1
1. isTrue : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanChecker::isTrue → KILLED |
return this.checkWithPredicate(Predicates.isTrue()); |
| 21 | } | |
| 22 | ||
| 23 | default BooleanChecker<T> isFalse() { | |
| 24 |
1
1. isFalse : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanChecker::isFalse → KILLED |
return this.checkWithPredicate(Predicates.isFalse()); |
| 25 | } | |
| 26 | ||
| 27 | @SuppressWarnings("unchecked") | |
| 28 | default BooleanChecker<T> check(Function<BooleanChecker<Boolean>, Predicate<Boolean>> phrase) { | |
| 29 | requireNonNull(phrase); | |
| 30 |
2
1. check : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanChecker::check → KILLED 2. lambda$check$0 : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanChecker::lambda$check$0 → KILLED |
return this.addCheckPhrase(v -> phrase.apply((BooleanChecker<Boolean>) v)); |
| 31 | } | |
| 32 | class Impl<T> extends | |
| 33 | Base< | |
| 34 | BooleanChecker<T>, | |
| 35 | T, | |
| 36 | Boolean> implements | |
| 37 | BooleanChecker<T> { | |
| 38 | public Impl(Supplier<T> baseValue, Function<T, Boolean> transformingFunction) { | |
| 39 | super(baseValue, transformingFunction); | |
| 40 | } | |
| 41 | ||
| 42 | @Override | |
| 43 | protected BooleanChecker<Boolean> rebase() { | |
| 44 |
1
1. rebase : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanChecker$Impl::rebase → KILLED |
return new BooleanChecker.Impl<>(this::value, trivialIdentityFunction()); |
| 45 | } | |
| 46 | } | |
| 47 | } | |
Mutations | ||
| 20 |
1.1 |
|
| 24 |
1.1 |
|
| 30 |
1.1 2.2 |
|
| 44 |
1.1 |