jmrozanec / jmrozanec/cron-utils
Support more helper functions within FieldExpression
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 272
- PR merge metrics
- No merged PRs in 30d
Description
This is a feature request that I think is not possible to do today. Please correct me if I'm wrong.
I want to know if a specific cron field is set to be always or every few times. I can check for always `*` like the code below, but I don't seem to find a way to check for "every" expression. Our project needs a way to detect and prevent cron expressions that are set to run every single or every few minutes.
```
CronField minute = cron.retrieve(CronFieldName.MINUTE);
if (minute.getExpression() == FieldExpression.always()) {
...
}
```
It would be nice if I can do something like `fieldExpression.isAlways()` and `fieldExpression.isEvery()`, or `fieldExpression.getType() == Every.INSTANCE` etc.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.