| 1 | package fr.sii.ogham.core.template.context; | |
| 2 | ||
| 3 | import static java.util.Collections.emptyMap; | |
| 4 | ||
| 5 | import java.util.Map; | |
| 6 | ||
| 7 | import fr.sii.ogham.core.exception.template.ContextException; | |
| 8 | ||
| 9 | /** | |
| 10 | * Context used when no variables is used. This is used to avoid | |
| 11 | * {@link NullPointerException} and many null checks. | |
| 12 | * | |
| 13 | * @author Aurélien Baudet | |
| 14 | * | |
| 15 | */ | |
| 16 | public class NullContext implements Context { | |
| 17 | ||
| 18 | @Override | |
| 19 | public Map<String, Object> getVariables() throws ContextException { | |
| 20 |
2
1. getVariables : replaced return value with null for fr/sii/ogham/core/template/context/NullContext::getVariables → NO_COVERAGE 2. getVariables : replaced return value with null for fr/sii/ogham/core/template/context/NullContext::getVariables → SURVIVED |
return emptyMap(); |
| 21 | } | |
| 22 | ||
| 23 | @Override | |
| 24 | public String toString() { | |
| 25 |
2
1. toString : replaced return value with "" for fr/sii/ogham/core/template/context/NullContext::toString → NO_COVERAGE 2. toString : replaced return value with "" for fr/sii/ogham/core/template/context/NullContext::toString → SURVIVED |
return "NullContext"; |
| 26 | } | |
| 27 | ||
| 28 | } | |
Mutations | ||
| 20 |
1.1 2.2 |
|
| 25 |
1.1 2.2 |