All Superinterfaces:
Serializable
All Known Implementing Classes:
CompositeCron, RebootCron, SingleCron

public interface Cron extends Serializable
Represents a cron expression.
  • Method Details

    • retrieve

      CronField retrieve(CronFieldName name)
      Retrieve value for cron field.
      Parameters:
      name - - cron field name. If null, a NullPointerException will be raised.
      Returns:
      CronField that corresponds to given CronFieldName
    • retrieveFieldsAsMap

      Map<CronFieldName,CronField> retrieveFieldsAsMap()
      Retrieve all cron field values as map.
      Returns:
      unmodifiable Map with key CronFieldName and values CronField, never null
    • asString

      String asString()
    • getCronDefinition

      CronDefinition getCronDefinition()
    • validate

      Cron validate()
      Validates this Cron instance by validating its cron expression.
      Returns:
      this Cron instance
      Throws:
      IllegalArgumentException - if the cron expression is invalid
    • equivalent

      boolean equivalent(CronMapper cronMapper, Cron cron)
      Provides means to compare if two cron expressions are equivalent.
      Parameters:
      cronMapper - - maps 'cron' parameter to this instance definition;
      cron - - any cron instance, never null
      Returns:
      boolean - true if equivalent; false otherwise.
    • equivalent

      boolean equivalent(Cron cron)
      Provides means to compare if two cron expressions are equivalent. Assumes same cron definition.
      Parameters:
      cron - - any cron instance, never null
      Returns:
      boolean - true if equivalent; false otherwise.
    • overlap

      boolean overlap(Cron cron)
      Checks if this cron expression overlaps with another cron expression.
      Parameters:
      cron - - The other cron expression to compare with, never null.
      Returns:
      true if the cron expressions overlap, false otherwise.