StreamTransformer.java

1
package com.github.dakusui.pcond.core.fluent.builtins;
2
3
import com.github.dakusui.pcond.core.fluent.AbstractObjectTransformer;
4
5
import java.util.function.Function;
6
import java.util.function.Predicate;
7
import java.util.function.Supplier;
8
import java.util.stream.Stream;
9
10
import static com.github.dakusui.pcond.internals.InternalUtils.trivialIdentityFunction;
11
12
public interface StreamTransformer<
13
    T,
14
    E> extends
15
    AbstractObjectTransformer<
16
        StreamTransformer<T, E>,
17
        StreamChecker<T, E>,
18
        T,
19
        Stream<E>
20
        > {
21
  static <E> StreamTransformer<Stream<E>, E> create(Supplier<Stream<E>> value) {
22 1 1. create : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer::create → KILLED
    return new Impl<>(value, trivialIdentityFunction());
23
  }
24
25
  @SuppressWarnings("unchecked")
26
  default StreamTransformer<T, E> transform(Function<StreamTransformer<T, E>, Predicate<Stream<E>>> clause) {
27 2 1. lambda$transform$0 : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer::lambda$transform$0 → NO_COVERAGE
2. transform : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer::transform → NO_COVERAGE
    return this.addTransformAndCheckClause(tx -> clause.apply((StreamTransformer<T, E>) tx));
28
  }
29
30
  class Impl<
31
      T,
32
      E> extends
33
      Base<
34
          StreamTransformer<T, E>,
35
          StreamChecker<T, E>,
36
          T,
37
          Stream<E>> implements
38
      StreamTransformer<T, E> {
39
40
    public Impl(Supplier<T> rootValue, Function<T, Stream<E>> root) {
41
      super(rootValue, root);
42
    }
43
44
    @Override
45
    protected StreamChecker<T, E> toChecker(Function<T, Stream<E>> transformFunction) {
46 1 1. toChecker : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer$Impl::toChecker → KILLED
      return new StreamChecker.Impl<>(this::baseValue, transformFunction);
47
    }
48
49
    @Override
50
    protected StreamTransformer<Stream<E>, E> rebase() {
51 1 1. rebase : replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer$Impl::rebase → NO_COVERAGE
      return new StreamTransformer.Impl<>(this::value, trivialIdentityFunction());
52
    }
53
  }
54
}

Mutations

22

1.1
Location : create
Killed by : com.github.dakusui.ut.thincrest.ut.styles.MoreFluentStreamTest.test_allMatch(com.github.dakusui.ut.thincrest.ut.styles.MoreFluentStreamTest)
replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer::create → KILLED

27

1.1
Location : lambda$transform$0
Killed by : none
replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer::lambda$transform$0 → NO_COVERAGE

2.2
Location : transform
Killed by : none
replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer::transform → NO_COVERAGE

46

1.1
Location : toChecker
Killed by : com.github.dakusui.ut.thincrest.ut.styles.MoreFluentStreamTest.test_allMatch(com.github.dakusui.ut.thincrest.ut.styles.MoreFluentStreamTest)
replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer$Impl::toChecker → KILLED

51

1.1
Location : rebase
Killed by : none
replaced return value with null for com/github/dakusui/pcond/core/fluent/builtins/StreamTransformer$Impl::rebase → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.7.3