All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.kagkarlsson.shaded.cronutils.model.field.expression.Between Maven / Gradle / Ivy

There is a newer version: 15.0.0
Show newest version


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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy