1 | package com.github.dakusui.pcond.core; | |
2 | ||
3 | import static com.github.dakusui.pcond.core.EvaluationContext.formNameOf; | |
4 | import static java.util.Objects.requireNonNull; | |
5 | ||
6 | public class EvaluableIo<I, E extends Evaluable<I>, O> { | |
7 | private final ValueHolder<I> input; | |
8 | private final E evaluable; | |
9 | private final EvaluationEntry.Type evaluableType; | |
10 | private final String formName; | |
11 | private ValueHolder<O> output; | |
12 | ||
13 | public EvaluableIo(ValueHolder<I> input, EvaluationEntry.Type evaluableType, E evaluable) { | |
14 | this(input, evaluableType, formNameOf(evaluableType, evaluable), evaluable); | |
15 | } | |
16 | ||
17 | public EvaluableIo(ValueHolder<I> input, EvaluationEntry.Type evaluableType, String formName, E evaluable) { | |
18 | this.input = requireNonNull(input); | |
19 | this.evaluableType = requireNonNull(evaluableType); | |
20 | this.formName = formName; | |
21 | this.evaluable = requireNonNull(evaluable); | |
22 | this.output = ValueHolder.create(); | |
23 | } | |
24 | ||
25 | public void output(ValueHolder<O> output) { | |
26 | this.output = requireNonNull(output).clone(); | |
27 | } | |
28 | ||
29 | public ValueHolder<I> input() { | |
30 |
1
1. input : replaced return value with null for com/github/dakusui/pcond/core/EvaluableIo::input → KILLED |
return this.input; |
31 | } | |
32 | ||
33 | public EvaluationEntry.Type evaluableType() { | |
34 |
1
1. evaluableType : replaced return value with null for com/github/dakusui/pcond/core/EvaluableIo::evaluableType → KILLED |
return this.evaluableType; |
35 | } | |
36 | ||
37 | public String formName() { | |
38 |
1
1. formName : replaced return value with "" for com/github/dakusui/pcond/core/EvaluableIo::formName → KILLED |
return this.formName; |
39 | } | |
40 | ||
41 | public E evaluable() { | |
42 |
1
1. evaluable : replaced return value with null for com/github/dakusui/pcond/core/EvaluableIo::evaluable → KILLED |
return this.evaluable; |
43 | } | |
44 | ||
45 | public ValueHolder<O> output() { | |
46 |
1
1. output : replaced return value with null for com/github/dakusui/pcond/core/EvaluableIo::output → KILLED |
return this.output; |
47 | } | |
48 | ||
49 | @Override | |
50 | public String toString() { | |
51 |
1
1. toString : replaced return value with "" for com/github/dakusui/pcond/core/EvaluableIo::toString → NO_COVERAGE |
return "evaluable:<" + evaluableType + ":" + evaluable + "> in:" + input + " out:" + output; |
52 | } | |
53 | } | |
Mutations | ||
30 |
1.1 |
|
34 |
1.1 |
|
38 |
1.1 |
|
42 |
1.1 |
|
46 |
1.1 |
|
51 |
1.1 |