Class TimerId

java.lang.Object
io.superdurable.dex.TimerId

public final class TimerId extends Object
Selects a timer condition within one Step execution.

A timer can be selected by the stable condition ID supplied to Timer.byDuration(java.time.Duration, String) or by its zero-based position among the Step's timer conditions. Prefer a condition ID when definitions may be reordered.

client.skipTimer(
        "order-123",
        StepExecutionId.of("AwaitPayment"),
        TimerId.byConditionId("payment-deadline"));
  • Method Details

    • byConditionId

      public static TimerId byConditionId(String conditionId)
      Selects a timer by its user-defined condition ID.
      Parameters:
      conditionId - the nonblank ID assigned when creating the timer
      Returns:
      a timer selector for that condition ID
      Throws:
      IllegalArgumentException - if conditionId is null or blank
    • byConditionIndex

      public static TimerId byConditionIndex(int index)
      Selects a timer by its condition index.
      Parameters:
      index - the zero-based timer condition index
      Returns:
      a timer selector for that index