1 | package fr.sii.ogham.core.builder.env; | |
2 | ||
3 | import java.util.Properties; | |
4 | ||
5 | import fr.sii.ogham.core.env.PropertyResolver; | |
6 | import fr.sii.ogham.core.fluent.AbstractParent; | |
7 | ||
8 | /** | |
9 | * Implementation that just delegates all operations to another builder. | |
10 | * | |
11 | * <p> | |
12 | * This is useful when a {@link EnvironmentBuilder} is used for a particular | |
13 | * parent and it must be inherited. As the parent types are not the same, you | |
14 | * can't directly use the same reference. So this implementation wraps the | |
15 | * original reference but as it is a new instance, it can have a different | |
16 | * parent builder. | |
17 | * </p> | |
18 | * | |
19 | * @author Aurélien Baudet | |
20 | * | |
21 | * @param <P> | |
22 | * the type of the parent builder (when calling {@link #and()} | |
23 | * method) | |
24 | */ | |
25 | public class EnvironmentBuilderDelegate<P> extends AbstractParent<P> implements EnvironmentBuilder<P> { | |
26 | private EnvironmentBuilder<?> delegate; | |
27 | ||
28 | /** | |
29 | * Wraps the delegate builder. The delegated builder parent is not used. | |
30 | * This instance uses the provided parent instead for chaining. | |
31 | * | |
32 | * @param parent | |
33 | * the new parent used for chaining | |
34 | * @param delegate | |
35 | * the instance that will really be updated | |
36 | */ | |
37 | public EnvironmentBuilderDelegate(P parent, EnvironmentBuilder<?> delegate) { | |
38 | super(parent); | |
39 | this.delegate = delegate; | |
40 | } | |
41 | ||
42 | @Override | |
43 | public EnvironmentBuilder<P> properties(String path) { | |
44 | delegate.properties(path); | |
45 |
1
1. properties : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::properties → NO_COVERAGE |
return this; |
46 | } | |
47 | ||
48 | @Override | |
49 | public EnvironmentBuilder<P> properties(String path, int priority) { | |
50 | delegate.properties(path, priority); | |
51 |
1
1. properties : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::properties → NO_COVERAGE |
return this; |
52 | } | |
53 | ||
54 | @Override | |
55 | public EnvironmentBuilder<P> properties(Properties properties) { | |
56 | delegate.properties(properties); | |
57 |
1
1. properties : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::properties → NO_COVERAGE |
return this; |
58 | } | |
59 | ||
60 | @Override | |
61 | public EnvironmentBuilder<P> properties(Properties properties, int priority) { | |
62 | delegate.properties(properties, priority); | |
63 |
1
1. properties : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::properties → NO_COVERAGE |
return this; |
64 | } | |
65 | ||
66 | @Override | |
67 | public EnvironmentBuilder<P> systemProperties() { | |
68 | delegate.systemProperties(); | |
69 |
1
1. systemProperties : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::systemProperties → NO_COVERAGE |
return this; |
70 | } | |
71 | ||
72 | @Override | |
73 | public EnvironmentBuilder<P> systemProperties(int priority) { | |
74 | delegate.systemProperties(priority); | |
75 |
1
1. systemProperties : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::systemProperties → NO_COVERAGE |
return this; |
76 | } | |
77 | ||
78 | @Override | |
79 | public ConverterBuilder<EnvironmentBuilder<P>> converter() { | |
80 |
1
1. converter : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::converter → NO_COVERAGE |
return new ConverterBuilderDelegate<>(this, delegate.converter()); |
81 | } | |
82 | ||
83 | @Override | |
84 | public EnvironmentBuilderDelegate<P> resolver(PropertyResolver resolver) { | |
85 | delegate.resolver(resolver); | |
86 |
1
1. resolver : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::resolver → NO_COVERAGE |
return this; |
87 | } | |
88 | ||
89 | @Override | |
90 | public PropertiesBuilder<EnvironmentBuilder<P>> properties() { | |
91 |
1
1. properties : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::properties → NO_COVERAGE |
return new PropertiesBuilderDelegate<>(this, delegate.properties()); |
92 | } | |
93 | ||
94 | @Override | |
95 | public PropertiesBuilder<EnvironmentBuilder<P>> properties(int priority) { | |
96 |
1
1. properties : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::properties → NO_COVERAGE |
return new PropertiesBuilderDelegate<>(this, delegate.properties(priority)); |
97 | } | |
98 | | |
99 | @Override | |
100 | public EnvironmentBuilder<P> override() { | |
101 | delegate.override(); | |
102 |
1
1. override : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::override → NO_COVERAGE |
return this; |
103 | } | |
104 | ||
105 | ||
106 | @Override | |
107 | public PropertyResolver build() { | |
108 |
1
1. build : replaced return value with null for fr/sii/ogham/core/builder/env/EnvironmentBuilderDelegate::build → NO_COVERAGE |
return delegate.build(); |
109 | } | |
110 | ||
111 | } | |
Mutations | ||
45 |
1.1 |
|
51 |
1.1 |
|
57 |
1.1 |
|
63 |
1.1 |
|
69 |
1.1 |
|
75 |
1.1 |
|
80 |
1.1 |
|
86 |
1.1 |
|
91 |
1.1 |
|
96 |
1.1 |
|
102 |
1.1 |
|
108 |
1.1 |