1 | package com.pivovarit.collectors; | |
2 | ||
3 | import java.util.concurrent.Executor; | |
4 | ||
5 | final class Options { | |
6 | ||
7 | private Options() { | |
8 | } | |
9 | ||
10 | sealed interface CollectingOption { | |
11 | } | |
12 | ||
13 | sealed interface StreamingOption extends CollectingOption { | |
14 | } | |
15 | ||
16 | static ThreadPool executor(Executor executor) { | |
17 |
1
1. executor : replaced return value with null for com/pivovarit/collectors/Options::executor → KILLED |
return new ThreadPool(executor); |
18 | } | |
19 | ||
20 | static Batched batched() { | |
21 |
1
1. batched : replaced return value with null for com/pivovarit/collectors/Options::batched → KILLED |
return new Batched(); |
22 | } | |
23 | ||
24 | static Parallelism parallelism(int parallelism) { | |
25 |
1
1. parallelism : replaced return value with null for com/pivovarit/collectors/Options::parallelism → KILLED |
return new Parallelism(parallelism); |
26 | } | |
27 | ||
28 | static Ordered ordered() { | |
29 |
1
1. ordered : replaced return value with null for com/pivovarit/collectors/Options::ordered → KILLED |
return new Ordered(); |
30 | } | |
31 | ||
32 | record Ordered() implements StreamingOption { | |
33 | } | |
34 | ||
35 | record Batched() implements StreamingOption, CollectingOption { | |
36 | } | |
37 | ||
38 | record ThreadPool(Executor executor) implements StreamingOption, CollectingOption { | |
39 | public ThreadPool { | |
40 | Preconditions.requireValidExecutor(executor); | |
41 | } | |
42 | } | |
43 | ||
44 | record Parallelism(int parallelism) implements StreamingOption, CollectingOption { | |
45 | public Parallelism { | |
46 | Preconditions.requireValidParallelism(parallelism); | |
47 | } | |
48 | } | |
49 | } | |
Mutations | ||
17 |
1.1 |
|
21 |
1.1 |
|
25 |
1.1 |
|
29 |
1.1 |