| 1 | /* | |
| 2 | * Copyright 2014-2026 Grzegorz Piwowarek, https://4comprehension.com/ | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * https://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package com.pivovarit.collectors; | |
| 17 | ||
| 18 | import java.util.ArrayList; | |
| 19 | import java.util.Collections; | |
| 20 | import java.util.List; | |
| 21 | import java.util.concurrent.Executor; | |
| 22 | import java.util.function.Consumer; | |
| 23 | ||
| 24 | sealed interface Configurer { | |
| 25 | ||
| 26 | List<ConfigProcessor.Option> getConfig(); | |
| 27 | ||
| 28 | static Streaming streaming(Consumer<Streaming> consumer) { | |
| 29 | var c = new Streaming(); | |
| 30 |
1
1. streaming : removed call to java/util/function/Consumer::accept → KILLED |
consumer.accept(c); |
| 31 |
1
1. streaming : replaced return value with null for com/pivovarit/collectors/Configurer::streaming → KILLED |
return c; |
| 32 | } | |
| 33 | ||
| 34 | static Collecting collecting(Consumer<Collecting> consumer) { | |
| 35 | var c = new Collecting(); | |
| 36 |
1
1. collecting : removed call to java/util/function/Consumer::accept → KILLED |
consumer.accept(c); |
| 37 |
1
1. collecting : replaced return value with null for com/pivovarit/collectors/Configurer::collecting → KILLED |
return c; |
| 38 | } | |
| 39 | ||
| 40 | final class Streaming implements Configurer { | |
| 41 | ||
| 42 | private final List<ConfigProcessor.Option> modifiers = new ArrayList<>(); | |
| 43 | ||
| 44 | public Streaming ordered() { | |
| 45 | modifiers.add(ConfigProcessor.Option.Ordered.INSTANCE); | |
| 46 |
1
1. ordered : replaced return value with null for com/pivovarit/collectors/Configurer$Streaming::ordered → KILLED |
return this; |
| 47 | } | |
| 48 | ||
| 49 | public Streaming batching() { | |
| 50 | modifiers.add(ConfigProcessor.Option.Batched.INSTANCE); | |
| 51 |
1
1. batching : replaced return value with null for com/pivovarit/collectors/Configurer$Streaming::batching → KILLED |
return this; |
| 52 | } | |
| 53 | ||
| 54 | public Streaming parallelism(int parallelism) { | |
| 55 | modifiers.add(new ConfigProcessor.Option.Parallelism(parallelism)); | |
| 56 |
1
1. parallelism : replaced return value with null for com/pivovarit/collectors/Configurer$Streaming::parallelism → SURVIVED |
return this; |
| 57 | } | |
| 58 | ||
| 59 | public Streaming executor(Executor executor) { | |
| 60 | modifiers.add(new ConfigProcessor.Option.ThreadPool(executor)); | |
| 61 |
1
1. executor : replaced return value with null for com/pivovarit/collectors/Configurer$Streaming::executor → KILLED |
return this; |
| 62 | } | |
| 63 | ||
| 64 | @Override | |
| 65 | public List<ConfigProcessor.Option> getConfig() { | |
| 66 |
1
1. getConfig : replaced return value with Collections.emptyList for com/pivovarit/collectors/Configurer$Streaming::getConfig → KILLED |
return Collections.unmodifiableList(modifiers); |
| 67 | } | |
| 68 | } | |
| 69 | ||
| 70 | final class Collecting implements Configurer { | |
| 71 | ||
| 72 | private final List<ConfigProcessor.Option> modifiers = new ArrayList<>(); | |
| 73 | ||
| 74 | public Collecting batching() { | |
| 75 | modifiers.add(ConfigProcessor.Option.Batched.INSTANCE); | |
| 76 |
1
1. batching : replaced return value with null for com/pivovarit/collectors/Configurer$Collecting::batching → KILLED |
return this; |
| 77 | } | |
| 78 | ||
| 79 | public Collecting parallelism(int parallelism) { | |
| 80 | modifiers.add(new ConfigProcessor.Option.Parallelism(parallelism)); | |
| 81 |
1
1. parallelism : replaced return value with null for com/pivovarit/collectors/Configurer$Collecting::parallelism → SURVIVED |
return this; |
| 82 | } | |
| 83 | ||
| 84 | public Collecting executor(Executor executor) { | |
| 85 | modifiers.add(new ConfigProcessor.Option.ThreadPool(executor)); | |
| 86 |
1
1. executor : replaced return value with null for com/pivovarit/collectors/Configurer$Collecting::executor → KILLED |
return this; |
| 87 | } | |
| 88 | ||
| 89 | @Override | |
| 90 | public List<ConfigProcessor.Option> getConfig() { | |
| 91 |
1
1. getConfig : replaced return value with Collections.emptyList for com/pivovarit/collectors/Configurer$Collecting::getConfig → KILLED |
return modifiers; |
| 92 | } | |
| 93 | } | |
| 94 | } | |
Mutations | ||
| 30 |
1.1 |
|
| 31 |
1.1 |
|
| 36 |
1.1 |
|
| 37 |
1.1 |
|
| 46 |
1.1 |
|
| 51 |
1.1 |
|
| 56 |
1.1 |
|
| 61 |
1.1 |
|
| 66 |
1.1 |
|
| 76 |
1.1 |
|
| 81 |
1.1 |
|
| 86 |
1.1 |
|
| 91 |
1.1 |