| 1 | package com.github.dakusui.pcond.core.fluent.builtins; | |
| 2 | ||
| 3 | ||
| 4 | import com.github.dakusui.pcond.core.fluent.AbstractObjectTransformer; | |
| 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 BooleanTransformer<T> extends | |
| 14 | AbstractObjectTransformer< | |
| 15 | BooleanTransformer<T>, | |
| 16 | BooleanChecker<T>, | |
| 17 | T, | |
| 18 | Boolean | |
| 19 | > { | |
| 20 | static BooleanTransformer<Boolean> create(Supplier<Boolean> value) { | |
| 21 |
1
1. create : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanTransformer::create → KILLED |
return new Impl<>(value, trivialIdentityFunction()); |
| 22 | } | |
| 23 | ||
| 24 | @SuppressWarnings("unchecked") | |
| 25 | default BooleanTransformer<T> transform(Function<BooleanTransformer<Boolean>, Predicate<Boolean>> clause) { | |
| 26 |
2
1. lambda$transform$0 : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanTransformer::lambda$transform$0 → KILLED 2. transform : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanTransformer::transform → KILLED |
return this.addTransformAndCheckClause(tx -> clause.apply((BooleanTransformer<Boolean>) tx)); |
| 27 | } | |
| 28 | class Impl<T> extends | |
| 29 | Base< | |
| 30 | BooleanTransformer<T>, | |
| 31 | BooleanChecker<T>, | |
| 32 | T, | |
| 33 | Boolean | |
| 34 | > implements | |
| 35 | BooleanTransformer<T> { | |
| 36 | public Impl(Supplier<T> value, Function<T, Boolean> transfomFunction) { | |
| 37 | super(value, transfomFunction); | |
| 38 | } | |
| 39 | ||
| 40 | @Override | |
| 41 | protected BooleanChecker<T> toChecker(Function<T, Boolean> transformFunction) { | |
| 42 |
1
1. toChecker : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanTransformer$Impl::toChecker → KILLED |
return new BooleanChecker.Impl<>(this::baseValue, requireNonNull(transformFunction)); |
| 43 | } | |
| 44 | ||
| 45 | @Override | |
| 46 | protected BooleanTransformer<Boolean> rebase() { | |
| 47 |
1
1. rebase : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/BooleanTransformer$Impl::rebase → KILLED |
return new Impl<>(this::value, trivialIdentityFunction()); |
| 48 | } | |
| 49 | } | |
| 50 | } | |
Mutations | ||
| 21 |
1.1 |
|
| 26 |
1.1 2.2 |
|
| 42 |
1.1 |
|
| 47 |
1.1 |