top.lshaci.framework.thread.masterworker.Task Maven / Gradle / Ivy
package top.lshaci.framework.thread.masterworker;
import lombok.Data;
/**
* The abstract task
*
* @author lshaci
*
* @param The task result type
* @since 0.0.4
*/
@Data
public abstract class Task {
/**
* Task name, must be unique
*/
private String uniqueName;
/**
* Construct a task with unique task name
*
* @param uniqueName the task name, must be unique
*/
protected Task(String uniqueName) {
this.uniqueName = uniqueName;
}
/**
* The concrete method of task execution
*
* @return the task result
*/
protected abstract R execute();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy