| 1 | package pro.verron.officestamper.preset.resolvers.localdate; | |
| 2 | ||
| 3 | import pro.verron.officestamper.api.StringResolver; | |
| 4 | ||
| 5 | import java.time.LocalDate; | |
| 6 | import java.time.format.DateTimeFormatter; | |
| 7 | ||
| 8 | /// Resolves [LocalDate] objects by formatting them with a [DateTimeFormatter]. | |
| 9 | /// | |
| 10 | /// @author Joseph Verron | |
| 11 | /// @version ${version} | |
| 12 | /// @since 1.6.4 | |
| 13 | public final class LocalDateResolver | |
| 14 | extends StringResolver<LocalDate> { | |
| 15 | private final DateTimeFormatter formatter; | |
| 16 | ||
| 17 | /// Uses [DateTimeFormatter#ISO_LOCAL_DATE] for formatting. | |
| 18 | public LocalDateResolver() { | |
| 19 | this(DateTimeFormatter.ISO_LOCAL_DATE); | |
| 20 | } | |
| 21 | ||
| 22 | /// Uses the given formatter for formatting. | |
| 23 | /// | |
| 24 | /// @param formatter the formatter to use. | |
| 25 | public LocalDateResolver(DateTimeFormatter formatter) { | |
| 26 | super(LocalDate.class); | |
| 27 | this.formatter = formatter; | |
| 28 | } | |
| 29 | ||
| 30 | @Override | |
| 31 | protected String resolve(LocalDate localDateTime) { | |
| 32 |
1
1. resolve : replaced return value with "" for pro/verron/officestamper/preset/resolvers/localdate/LocalDateResolver::resolve → KILLED |
return localDateTime.format(formatter); |
| 33 | } | |
| 34 | } | |
Mutations | ||
| 32 |
1.1 |