ConfigurationValueUtils.java

1
package fr.sii.ogham.core.util;
2
3
/**
4
 * Some utility methods for configuration values.
5
 * 
6
 * @author Aurélien Baudet
7
 *
8
 */
9
public final class ConfigurationValueUtils {
10
	/**
11
	 * Returns the first non-null value.
12
	 * 
13
	 * @param <T>
14
	 *            the type of values
15
	 * @param values
16
	 *            the value array
17
	 * @return the first non-null value
18
	 */
19
	@SafeVarargs
20
	public static <T> T firstValue(T... values) {
21
		for (T value : values) {
22 3 1. firstValue : negated conditional → NO_COVERAGE
2. firstValue : negated conditional → SURVIVED
3. firstValue : negated conditional → TIMED_OUT
			if (value != null) {
23 2 1. firstValue : replaced return value with null for fr/sii/ogham/core/util/ConfigurationValueUtils::firstValue → NO_COVERAGE
2. firstValue : replaced return value with null for fr/sii/ogham/core/util/ConfigurationValueUtils::firstValue → SURVIVED
				return value;
24
			}
25
		}
26
		return null;
27
	}
28
29
	private ConfigurationValueUtils() {
30
		super();
31
	}
32
}

Mutations

22

1.1
Location : firstValue
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : firstValue
Killed by : none
negated conditional → TIMED_OUT

3.3
Location : firstValue
Killed by : none
negated conditional → SURVIVED

23

1.1
Location : firstValue
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/ConfigurationValueUtils::firstValue → NO_COVERAGE

2.2
Location : firstValue
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/ConfigurationValueUtils::firstValue → SURVIVED

Active mutators

Tests examined


Report generated by PIT OGHAM