1 | package fr.sii.ogham.core.builder.configuration; | |
2 | ||
3 | /** | |
4 | * Override the current value only if it is not set ({@code null}). | |
5 | * | |
6 | * @author Aurélien Baudet | |
7 | * | |
8 | * @param <V> | |
9 | * the type of the vlaue | |
10 | */ | |
11 | public class CurrentValueNotSetOverride<V> implements MayOverride<V> { | |
12 | private final V value; | |
13 | ||
14 | /** | |
15 | * Initializes with the new value to set if current value is not set. | |
16 | * | |
17 | * @param value | |
18 | * the new value | |
19 | */ | |
20 | public CurrentValueNotSetOverride(V value) { | |
21 | super(); | |
22 | this.value = value; | |
23 | } | |
24 | ||
25 | @Override | |
26 | public V override(V currentValue) { | |
27 |
16
1. override : negated conditional → NO_COVERAGE 2. override : negated conditional → SURVIVED 3. override : replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → NO_COVERAGE 4. override : replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → SURVIVED 5. override : negated conditional → KILLED 6. override : negated conditional → KILLED 7. override : negated conditional → KILLED 8. override : negated conditional → KILLED 9. override : negated conditional → KILLED 10. override : negated conditional → KILLED 11. override : replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → KILLED 12. override : replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → KILLED 13. override : replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → KILLED 14. override : replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → KILLED 15. override : replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → KILLED 16. override : replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → KILLED |
return currentValue == null ? value : currentValue; |
28 | } | |
29 | ||
30 | } | |
Mutations | ||
27 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10.10 11.11 12.12 13.13 14.14 15.15 16.16 |