MayOverride.java

1
package fr.sii.ogham.core.builder.configuration;
2
3
/**
4
 * If the new value should override the current value, the new value is
5
 * returned. If the new value should not override, the current value is
6
 * returned.
7
 * 
8
 * @author Aurélien Baudet
9
 *
10
 * @param <V>
11
 *            the type of the value
12
 */
13
public interface MayOverride<V> {
14
15
	/**
16
	 * If the new value should override the current value, the new value is
17
	 * returned. If the new value should not override, the current value is
18
	 * returned.
19
	 * 
20
	 * @param currentValue
21
	 *            the current value that may be overridden
22
	 * @return the new value
23
	 */
24
	V override(V currentValue);
25
26
	/**
27
	 * Override current value only if the value parameter is not {@code null}.
28
	 * 
29
	 * @param <V>
30
	 *            the type of the value
31
	 * @param value
32
	 *            the new value to set if not {@code null}
33
	 * @return the override control
34
	 */
35
	static <V> MayOverride<V> overrideIfNonNull(V value) {
36 2 1. overrideIfNonNull : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNonNull → NO_COVERAGE
2. overrideIfNonNull : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNonNull → KILLED
		return new NonNullOverride<>(value);
37
	}
38
39
	/**
40
	 * Always override current value.
41
	 * 
42
	 * @param <V>
43
	 *            the type of the value
44
	 * @param value
45
	 *            the new value to set
46
	 * @return the override control
47
	 */
48
	static <V> MayOverride<V> alwaysOverride(V value) {
49 2 1. alwaysOverride : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::alwaysOverride → NO_COVERAGE
2. alwaysOverride : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::alwaysOverride → KILLED
		return new AlwaysOverride<>(value);
50
	}
51
52
	/**
53
	 * Override current value only if the current value is not set
54
	 * ({@code null}). If current value is set, the new value is not applied.
55
	 * 
56
	 * @param <V>
57
	 *            the type of the value
58
	 * @param value
59
	 *            the new value to set if current value is {@code null}
60
	 * @return the override control
61
	 */
62
	static <V> MayOverride<V> overrideIfNotSet(V value) {
63 8 1. overrideIfNotSet : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → NO_COVERAGE
2. overrideIfNotSet : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED
3. overrideIfNotSet : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED
4. overrideIfNotSet : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED
5. overrideIfNotSet : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED
6. overrideIfNotSet : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED
7. overrideIfNotSet : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED
8. overrideIfNotSet : replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED
		return new CurrentValueNotSetOverride<>(value);
64
	}
65
66
}

Mutations

36

1.1
Location : overrideIfNonNull
Killed by : oghamcore.ut.core.builder.configuration.MayOverrideSpec
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNonNull → KILLED

2.2
Location : overrideIfNonNull
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNonNull → NO_COVERAGE

49

1.1
Location : alwaysOverride
Killed by : oghamcore.ut.core.builder.configuration.MayOverrideSpec
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::alwaysOverride → KILLED

2.2
Location : alwaysOverride
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::alwaysOverride → NO_COVERAGE

63

1.1
Location : overrideIfNotSet
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredButUnconfiguredTemplateParsersCantHandleMultiTemplateContent(oghamall.it.configuration.EmptyBuilderTest)
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED

2.2
Location : overrideIfNotSet
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED

3.3
Location : overrideIfNotSet
Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED

4.4
Location : overrideIfNotSet
Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest)
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED

5.5
Location : overrideIfNotSet
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED

6.6
Location : overrideIfNotSet
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → NO_COVERAGE

7.7
Location : overrideIfNotSet
Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests.oghamPropertiesWithSpringPropsShouldUseOghamPropertiesPrecedence(oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED

8.8
Location : overrideIfNotSet
Killed by : oghamcore.ut.core.builder.configuration.MayOverrideSpec
replaced return value with null for fr/sii/ogham/core/builder/configuration/MayOverride::overrideIfNotSet → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM