1 | package fr.sii.ogham.template.thymeleaf.v3.adapter; | |
2 | ||
3 | import java.util.function.Consumer; | |
4 | ||
5 | import org.thymeleaf.templateresolver.AbstractConfigurableTemplateResolver; | |
6 | import org.thymeleaf.templateresolver.ITemplateResolver; | |
7 | ||
8 | import fr.sii.ogham.template.thymeleaf.common.TemplateResolverOptions; | |
9 | import fr.sii.ogham.template.thymeleaf.common.adapter.TemplateResolverOptionsApplier; | |
10 | ||
11 | /** | |
12 | * Apply options on {@link AbstractConfigurableTemplateResolver} instance. | |
13 | * | |
14 | * @author Aurélien Baudet | |
15 | * | |
16 | */ | |
17 | public class ThymeleafV3TemplateOptionsApplier implements TemplateResolverOptionsApplier { | |
18 | ||
19 | @Override | |
20 | public void apply(ITemplateResolver templateResolver, TemplateResolverOptions options) { | |
21 |
4
1. apply : negated conditional → NO_COVERAGE 2. apply : negated conditional → TIMED_OUT 3. apply : negated conditional → KILLED 4. apply : negated conditional → KILLED |
if (templateResolver instanceof AbstractConfigurableTemplateResolver) { |
22 | // TODO: handle other options ? | |
23 | AbstractConfigurableTemplateResolver resolver = (AbstractConfigurableTemplateResolver) templateResolver; | |
24 |
3
1. apply : removed call to fr/sii/ogham/template/thymeleaf/v3/adapter/ThymeleafV3TemplateOptionsApplier::set → NO_COVERAGE 2. apply : removed call to fr/sii/ogham/template/thymeleaf/v3/adapter/ThymeleafV3TemplateOptionsApplier::set → SURVIVED 3. apply : removed call to fr/sii/ogham/template/thymeleaf/v3/adapter/ThymeleafV3TemplateOptionsApplier::set → TIMED_OUT |
set(resolver::setTemplateMode, options.getTemplateMode()); |
25 |
4
1. apply : removed call to fr/sii/ogham/template/thymeleaf/v3/adapter/ThymeleafV3TemplateOptionsApplier::set → SURVIVED 2. apply : removed call to fr/sii/ogham/template/thymeleaf/v3/adapter/ThymeleafV3TemplateOptionsApplier::set → NO_COVERAGE 3. apply : removed call to fr/sii/ogham/template/thymeleaf/v3/adapter/ThymeleafV3TemplateOptionsApplier::set → TIMED_OUT 4. apply : removed call to fr/sii/ogham/template/thymeleaf/v3/adapter/ThymeleafV3TemplateOptionsApplier::set → KILLED |
set(resolver::setCacheable, options.getCacheable()); |
26 | } | |
27 | } | |
28 | ||
29 | private <T> void set(Consumer<T> setter, T value) { | |
30 |
4
1. set : negated conditional → NO_COVERAGE 2. set : negated conditional → TIMED_OUT 3. set : negated conditional → KILLED 4. set : negated conditional → KILLED |
if (value != null) { |
31 |
3
1. set : removed call to java/util/function/Consumer::accept → NO_COVERAGE 2. set : removed call to java/util/function/Consumer::accept → TIMED_OUT 3. set : removed call to java/util/function/Consumer::accept → KILLED |
setter.accept(value); |
32 | } | |
33 | } | |
34 | ||
35 | } | |
Mutations | ||
21 |
1.1 2.2 3.3 4.4 |
|
24 |
1.1 2.2 3.3 |
|
25 |
1.1 2.2 3.3 4.4 |
|
30 |
1.1 2.2 3.3 4.4 |
|
31 |
1.1 2.2 3.3 |