Interface OffsetWhen<D>
- Type Parameters:
D- The type of the translated data.
- All Superinterfaces:
Translator<D>
Interface for translating "timing.repeat.offset" / "timing.repeat.when".
- Since:
- 1.0.0
- Author:
- jy95
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionextractTime(int minutes) Extracts the time components (days, hours, minutes) from a given offset in minutes.default CompletableFuture<String> turnOffsetValueToText(TranslationService<?> translationService, int offset) Converts an offset value (in minutes) into a human-readable time string.Methods inherited from interface io.github.jy95.fds.common.types.Translator
convert, isPresent
-
Field Details
-
order
Constantorder
-
-
Method Details
-
extractTime
Extracts the time components (days, hours, minutes) from a given offset in minutes.- Parameters:
minutes- The offset in minutes to be converted into days, hours, and minutes.- Returns:
- A
Mapwith keys "d" (days), "h" (hours), and "min" (minutes), and their corresponding values.
-
turnOffsetValueToText
default CompletableFuture<String> turnOffsetValueToText(TranslationService<?> translationService, int offset) Converts an offset value (in minutes) into a human-readable time string. The result combines the extracted time components (days, hours, minutes) into a formatted string.- Parameters:
translationService- aTranslationServiceobjectoffset- The offset in minutes to be converted.- Returns:
- A
CompletableFuturecontaining the formatted string representing the offset. - Since:
- 2.1.1
-