Skip to content

Support more helper functions within FieldExpression #690

Description

@fangming-ning-sp

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions