Interface OffsetWhen<D>

Type Parameters:
D - The type of the translated data.
All Superinterfaces:
Translator<D>

public interface OffsetWhen<D> extends Translator<D>
Interface for translating "timing.repeat.offset" / "timing.repeat.when".
Since:
1.0.0
Author:
jy95
  • Field Details

    • order

      static final List<String> order
      Constant order
  • Method Details

    • extractTime

      default Map<String,Integer> extractTime(int minutes)
      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 Map with 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 - a TranslationService object
      offset - The offset in minutes to be converted.
      Returns:
      A CompletableFuture containing the formatted string representing the offset.
      Since:
      2.1.1