Interface Cron
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CompositeCron,RebootCron,SingleCron
Represents a cron expression.
-
Method Summary
Modifier and TypeMethodDescriptionasString()booleanequivalent(CronMapper cronMapper, Cron cron) Provides means to compare if two cron expressions are equivalent.booleanequivalent(Cron cron) Provides means to compare if two cron expressions are equivalent.booleanChecks if this cron expression overlaps with another cron expression.retrieve(CronFieldName name) Retrieve value for cron field.Retrieve all cron field values as map.validate()Validates this Cron instance by validating its cron expression.
-
Method Details
-
retrieve
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
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
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
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.
-