
com.lifeonwalden.springscheduling.cronBuilder.model.Between Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-scheduler Show documentation
Show all versions of spring-scheduler Show documentation
A persistence scheduler system based on Spring framework
package com.lifeonwalden.springscheduling.cronBuilder.model;
import com.lifeonwalden.springscheduling.cronBuilder.time.CronTime;
/**
* 区间范围
*
* @author luhong
*
*/
public class Between implements FieldDefinition {
private CronTime start;
private CronTime end;
public Between(CronTime start, CronTime end) {
if (start.toCronTime() >= end.toCronTime()) {
throw new RuntimeException("Invalid range.");
}
this.start = start;
this.end = end;
}
@Override
public String toExpression() {
return Integer.toString(start.toCronTime()) + "-" + Integer.toString(end.toCronTime());
}
@Override
public boolean isValid(Class> clazz) {
return clazz.isInstance(start) && clazz.isInstance(end);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy