1 | package com.github.valid8j.pcond.core.fluent.builtins; | |
2 | ||
3 | import com.github.valid8j.pcond.core.fluent.Matcher; | |
4 | import com.github.valid8j.pcond.forms.Functions; | |
5 | import com.github.valid8j.pcond.forms.Printables; | |
6 | import com.github.valid8j.pcond.core.fluent.AbstractObjectTransformer; | |
7 | import com.github.valid8j.pcond.internals.InternalUtils; | |
8 | ||
9 | import java.util.Collection; | |
10 | import java.util.List; | |
11 | import java.util.function.Function; | |
12 | import java.util.function.Supplier; | |
13 | ||
14 | public interface ListTransformer< | |
15 | T, | |
16 | E | |
17 | > extends | |
18 | AbstractObjectTransformer< | |
19 | ListTransformer<T, E>, | |
20 | ListChecker<T, E>, | |
21 | T, | |
22 | List<E>> { | |
23 | static <E> ListTransformer<List<E>, E> create(Supplier<List<E>> value) { | |
24 |
1
1. create : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer::create → KILLED |
return new Impl<>(value, InternalUtils.trivialIdentityFunction()); |
25 | } | |
26 | ||
27 | default ObjectTransformer<T, E> elementAt(int i) { | |
28 |
1
1. elementAt : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer::elementAt → KILLED |
return this.toObject(Functions.elementAt(i)); |
29 | } | |
30 | ||
31 | default IntegerTransformer<T> size() { | |
32 |
1
1. size : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer::size → KILLED |
return this.toInteger(Functions.size()); |
33 | } | |
34 | ||
35 | default ListTransformer<T, E> subList(int begin, int end) { | |
36 |
2
1. lambda$subList$0 : replaced return value with Collections.emptyList for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer::lambda$subList$0 → NO_COVERAGE 2. subList : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer::subList → KILLED |
return this.toList(Printables.function("subList[" + begin + "," + end + "]", v -> v.subList(begin, end))); |
37 | } | |
38 | ||
39 | default ListTransformer<T, E> subList(int begin) { | |
40 |
2
1. lambda$subList$1 : replaced return value with Collections.emptyList for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer::lambda$subList$1 → NO_COVERAGE 2. subList : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer::subList → KILLED |
return this.toList(Printables.function("subList[" + begin + "]", v -> v.subList(begin, v.size()))); |
41 | } | |
42 | ||
43 | default StreamTransformer<T, E> stream() { | |
44 |
1
1. stream : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer::stream → KILLED |
return this.toStream(Printables.function("listStream", Collection::stream)); |
45 | } | |
46 | ||
47 | default BooleanTransformer<T> isEmpty() { | |
48 |
1
1. isEmpty : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer::isEmpty → KILLED |
return this.toBoolean(Printables.function("listIsEmpty", List::isEmpty)); |
49 | } | |
50 | ||
51 | class Impl<T, E> extends | |
52 | Base< | |
53 | ListTransformer<T, E>, | |
54 | ListChecker<T, E>, | |
55 | T, | |
56 | List<E>> implements | |
57 | ListTransformer<T, E> { | |
58 | public Impl(Supplier<T> value, Function<T, List<E>> transformFunction) { | |
59 | super(value, transformFunction); | |
60 | } | |
61 | ||
62 | @Override | |
63 | protected ListChecker<T, E> toChecker(Function<T, List<E>> transformFunction) { | |
64 |
1
1. toChecker : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer$Impl::toChecker → KILLED |
return new ListChecker.Impl<>(this::baseValue, transformFunction); |
65 | } | |
66 | ||
67 | @Override | |
68 | protected Matcher<?, List<E>, List<E>> rebase() { | |
69 |
1
1. rebase : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/ListTransformer$Impl::rebase → NO_COVERAGE |
return new Impl<>(this::value, InternalUtils.trivialIdentityFunction()); |
70 | } | |
71 | } | |
72 | } | |
Mutations | ||
24 |
1.1 |
|
28 |
1.1 |
|
32 |
1.1 |
|
36 |
1.1 2.2 |
|
40 |
1.1 2.2 |
|
44 |
1.1 |
|
48 |
1.1 |
|
64 |
1.1 |
|
69 |
1.1 |