All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.lshaci.framework.thread.masterworker.Task Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
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