| 1 | package fr.sii.ogham.core.condition.provider; | |
| 2 | ||
| 3 | import fr.sii.ogham.core.condition.Condition; | |
| 4 | ||
| 5 | /** | |
| 6 | * Simple provider that always provide the same condition. | |
| 7 | * | |
| 8 | * @author Aurélien Baudet | |
| 9 | * | |
| 10 | * @param <T> | |
| 11 | * the type of the object handled by the provider | |
| 12 | * @param <C> | |
| 13 | * the type of the object under conditions | |
| 14 | */ | |
| 15 | public class StaticConditionProvider<T, C> implements ConditionProvider<T, C> { | |
| 16 | private final Condition<C> condition; | |
| 17 | ||
| 18 | /** | |
| 19 | * Initializes with the fixed condition that will always be returned when | |
| 20 | * calling {@link #provide(Object)}. | |
| 21 | * | |
| 22 | * @param condition | |
| 23 | * the condition to always use | |
| 24 | */ | |
| 25 | public StaticConditionProvider(Condition<C> condition) { | |
| 26 | super(); | |
| 27 | this.condition = condition; | |
| 28 | } | |
| 29 | ||
| 30 | @Override | |
| 31 | public Condition<C> provide(T source) { | |
| 32 |
1
1. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/StaticConditionProvider::provide → NO_COVERAGE |
return condition; |
| 33 | } | |
| 34 | ||
| 35 | } | |
Mutations | ||
| 32 |
1.1 |