1 | package fr.sii.ogham.core.builder.priority; | |
2 | ||
3 | import fr.sii.ogham.core.builder.context.BuildContext; | |
4 | ||
5 | /** | |
6 | * {@link PriorityProvider} used to encapsulate the default behavior for | |
7 | * providing priority value for a possible implementation. | |
8 | * | |
9 | * <p> | |
10 | * If uses the underlying {@link AnnotationPriorityProvider} to provide the | |
11 | * priority value by scanning the class for the presence of {@link Priority} | |
12 | * annotation. | |
13 | * | |
14 | * @author Aurélien Baudet | |
15 | * | |
16 | * @param <T> | |
17 | * the kind of implementation | |
18 | */ | |
19 | public class ImplementationPriorityProvider<T> implements PriorityProvider<T> { | |
20 | private final AnnotationPriorityProvider annotationProvider; | |
21 | ||
22 | public ImplementationPriorityProvider(BuildContext buildContext) { | |
23 | super(); | |
24 | annotationProvider = new AnnotationPriorityProvider(buildContext, new AutoDecrementPriorityProvider<>()); | |
25 | } | |
26 | ||
27 | @Override | |
28 | public int provide(T source) { | |
29 |
4
1. provide : replaced int return with 0 for fr/sii/ogham/core/builder/priority/ImplementationPriorityProvider::provide → SURVIVED 2. provide : replaced int return with 0 for fr/sii/ogham/core/builder/priority/ImplementationPriorityProvider::provide → NO_COVERAGE 3. provide : replaced int return with 0 for fr/sii/ogham/core/builder/priority/ImplementationPriorityProvider::provide → KILLED 4. provide : replaced int return with 0 for fr/sii/ogham/core/builder/priority/ImplementationPriorityProvider::provide → KILLED |
return annotationProvider.provide(source.getClass()); |
30 | } | |
31 | } | |
Mutations | ||
29 |
1.1 2.2 3.3 4.4 |