19 package org.turro.scheduler.task.settings;
21 import java.util.Date;
22 import java.util.Objects;
23 import org.turro.elephant.context.IConstructor;
24 import org.turro.reflection.Reflections;
25 import org.turro.scheduler.task.AbstractTask;
26 import org.turro.scheduler.task.constraints.TaskConstraints;
27 import org.turro.util.Comparison;
35 private boolean active;
36 private String implementation, description, data;
37 private Date startDate, endDate;
49 return implementation;
53 this.implementation = implementation;
61 this.description = description;
77 this.startDate = startDate;
85 this.endDate = endDate;
93 this.constraints = constraints;
97 return (startDate ==
null || now.after(startDate)) &&
98 (endDate ==
null || now.before(endDate)) &&
121 return Comparison.ascendant()
134 hash = 23 * hash + (this.active ? 1 : 0);
135 hash = 23 * hash + Objects.hashCode(this.implementation);
136 hash = 23 * hash + Objects.hashCode(this.description);
137 hash = 23 * hash + Objects.hashCode(this.data);
138 hash = 23 * hash + Objects.hashCode(this.startDate);
139 hash = 23 * hash + Objects.hashCode(this.endDate);
140 hash = 23 * hash + Objects.hashCode(this.constraints);
152 if (getClass() != obj.getClass()) {
156 if (this.active != other.active) {
159 if (!Objects.equals(
this.implementation, other.implementation)) {
162 if (!Objects.equals(
this.description, other.description)) {
165 if (!Objects.equals(
this.data, other.data)) {
168 if (!Objects.equals(
this.startDate, other.startDate)) {
171 if (!Objects.equals(
this.endDate, other.endDate)) {
174 return Objects.
equals(this.constraints, other.constraints);
void setConstructor(IConstructor constructor)
void setSettings(TaskSettings settings)
abstract String getName()
boolean isValid(Date date)
String getImplementation()
void setDescription(String description)
static TaskSettings from(AbstractTask task)
TaskConstraints getConstraints()
void setData(String data)
AbstractTask build(IConstructor constructor)
int compareTo(TaskSettings o)
boolean shouldRun(Date now)
void setConstraints(TaskConstraints constraints)
void setImplementation(String implementation)
boolean equals(Object obj)
void setEndDate(Date endDate)
void setActive(boolean active)
void setStartDate(Date startDate)