CurrentValueNotSetOverride.java

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 2 1. override : negated conditional → RUN_ERROR
2. override : replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → RUN_ERROR
		return currentValue == null ? value : currentValue;
28
	}
29
30
}

Mutations

27

1.1
Location : override
Killed by :
negated conditional → RUN_ERROR

2.2
Location : override
Killed by :
replaced return value with null for fr/sii/ogham/core/builder/configuration/CurrentValueNotSetOverride::override → RUN_ERROR

Active mutators

Tests examined


Report generated by PIT 1.13.1