use of com.cronutils.model.field.expression.And in project cron-utils by jmrozanec.
the class AndFieldValueGeneratorTest method setUp.
@Before
public void setUp() {
constraints = FieldConstraintsBuilder.instance().createConstraintsInstance();
fieldValueGenerator = new AndFieldValueGenerator(new CronField(CronFieldName.MONTH, new And().and(new On(new IntegerFieldValue(VALUE0))).and(new On(new IntegerFieldValue(VALUE1))).and(new On(new IntegerFieldValue(VALUE2))), constraints));
}
use of com.cronutils.model.field.expression.And in project cron-utils by jmrozanec.
the class AndDayOfWeekValueGenerator method generateCandidatesNotIncludingIntervalExtremes.
@Override
protected List<Integer> generateCandidatesNotIncludingIntervalExtremes(final int start, final int end) {
final List<Integer> values = new ArrayList<>();
final And and = (And) cronField.getExpression();
for (final FieldExpression expression : and.getExpressions()) {
final CronField cronField = new CronField(CronFieldName.DAY_OF_WEEK, expression, this.cronField.getConstraints());
final List<Integer> candidatesList = FieldValueGeneratorFactory.createDayOfWeekValueGeneratorInstance(cronField, year, month, mondayDoWValue).generateCandidates(start, end);
// add them to the master list
if (candidatesList != null) {
values.addAll(candidatesList);
}
}
return values;
}
Aggregations