forked from LupusNobilis/java-org.hwo
43 lines
817 B
Java
43 lines
817 B
Java
package org.hwo.tasklet;
|
|
|
|
|
|
public abstract class Tasklet {
|
|
|
|
private String description;
|
|
private boolean started;
|
|
private String progress;
|
|
|
|
public Tasklet(String description){
|
|
this.description = description;
|
|
}
|
|
public Tasklet(){
|
|
this.description = "anonymous";
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public boolean isStarted() {
|
|
return started;
|
|
}
|
|
public void setStarted(boolean started) {
|
|
this.started = started;
|
|
}
|
|
|
|
public String getProgress() {
|
|
return progress;
|
|
}
|
|
public void setProgress(String progress) {
|
|
this.progress = progress;
|
|
}
|
|
|
|
public abstract void run();
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.format("%s %s %s",description,isStarted() ? "läuft" : "wartet", (this.progress==null) ? "" : String.format("[%s]", this.progress));
|
|
}
|
|
|
|
}
|