Class CronExpression

java.lang.Object
com.iantapply.orchestra.schedule.CronExpression

public final class CronExpression extends Object
Five-field cron parser supporting wildcards, lists, ranges, steps, and English month/day names.
  • Constructor Details

    • CronExpression

      public CronExpression(String expression)
      Parses a five-field cron expression.
      Parameters:
      expression - minute, hour, day-of-month, month, and day-of-week fields
  • Method Details

    • nextAfter

      public Instant nextAfter(Instant after, ZoneId zone)
      Finds the next matching minute.
      Parameters:
      after - exclusive lower bound
      zone - evaluation time zone
      Returns:
      next matching instant
      Throws:
      IllegalStateException - if no match occurs within five years
    • matches

      public boolean matches(Instant instant, ZoneId zone)
      Tests one instant against this expression.
      Parameters:
      instant - instant to test
      zone - evaluation time zone
      Returns:
      whether all cron fields match