com.github.kagkarlsson.shaded.cronutils.model.field.expression.Between Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of db-scheduler Show documentation
Show all versions of db-scheduler Show documentation
Simple persistent scheduler for scheduled tasks, recurring or ad-hoc.
package com.github.kagkarlsson.shaded.cronutils.model.field.expression;
import com.github.kagkarlsson.shaded.cronutils.model.field.expression.visitor.FieldExpressionVisitor;
import com.github.kagkarlsson.shaded.cronutils.model.field.value.FieldValue;
/**
* Represents a range in a cron expression.
*/
public class Between extends FieldExpression {
private static final long serialVersionUID = 549075258664100474L;
private final FieldValue> from;
private final FieldValue> to;
public Between(final Between between) {
this(between.getFrom(), between.getTo());
}
public Between(final FieldValue> from, final FieldValue> to) {
this.from = from;
this.to = to;
}
public FieldValue> getFrom() {
return from;
}
public FieldValue> getTo() {
return to;
}
@Override
public FieldExpression accept(FieldExpressionVisitor visitor) {
return visitor.visit(this);
}
@Override
public String asString() {
return String.format("%s-%s", from, to);
}
}