1 | package fr.sii.ogham.core.convert; | |
2 | ||
3 | /** | |
4 | * A no-op converter that just casts the source to match the target type. | |
5 | * | |
6 | * Cast is only applied if the source object is an instance of target type. | |
7 | * | |
8 | * @author Aurélien Baudet | |
9 | * | |
10 | */ | |
11 | public class NoConversionNeededConverter implements SupportingConverter { | |
12 | ||
13 | @SuppressWarnings("unchecked") | |
14 | @Override | |
15 | public <T> T convert(Object source, Class<T> targetType) { | |
16 |
7
1. convert : replaced return value with null for fr/sii/ogham/core/convert/NoConversionNeededConverter::convert → NO_COVERAGE 2. convert : replaced return value with null for fr/sii/ogham/core/convert/NoConversionNeededConverter::convert → TIMED_OUT 3. convert : replaced return value with null for fr/sii/ogham/core/convert/NoConversionNeededConverter::convert → KILLED 4. convert : replaced return value with null for fr/sii/ogham/core/convert/NoConversionNeededConverter::convert → KILLED 5. convert : replaced return value with null for fr/sii/ogham/core/convert/NoConversionNeededConverter::convert → KILLED 6. convert : replaced return value with null for fr/sii/ogham/core/convert/NoConversionNeededConverter::convert → KILLED 7. convert : replaced return value with null for fr/sii/ogham/core/convert/NoConversionNeededConverter::convert → KILLED |
return (T) source; |
17 | } | |
18 | ||
19 | @Override | |
20 | public boolean supports(Class<?> sourceType, Class<?> targetType) { | |
21 |
11
1. supports : replaced boolean return with false for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → NO_COVERAGE 2. supports : replaced boolean return with true for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → NO_COVERAGE 3. supports : replaced boolean return with true for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → SURVIVED 4. supports : replaced boolean return with false for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → TIMED_OUT 5. supports : replaced boolean return with true for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → TIMED_OUT 6. supports : replaced boolean return with false for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → KILLED 7. supports : replaced boolean return with false for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → KILLED 8. supports : replaced boolean return with false for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → KILLED 9. supports : replaced boolean return with false for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → KILLED 10. supports : replaced boolean return with false for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → KILLED 11. supports : replaced boolean return with true for fr/sii/ogham/core/convert/NoConversionNeededConverter::supports → KILLED |
return targetType.isAssignableFrom(sourceType); |
22 | } | |
23 | ||
24 | } | |
Mutations | ||
16 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 |
|
21 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10.10 11.11 |