![JAR search and dependency download from the Maven repository](/logo.png)
com.github.andyshao.system.Task Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Gear Show documentation
Show all versions of Gear Show documentation
Enhance and formating the coding of JDK
The newest version!
package com.github.andyshao.system;
/**
*
* Title:
* Descript:
* Copyright: Copryright(c) Sep 10, 2015
* Encoding:UNIX UTF-8
*
* @author Andy.Shao
*
*/
public interface Task {
/**empty task*/
public static final Task EMPTY_TASK = new Task() {
@Override
public Task getNextTask() {
return null;
}
@Override
public boolean isDuty(String[] args) {
return true;
}
@Override
public void process(String[] args) {
//do nothing...
}
};
/**
* get next task
* @return next task
*/
public Task getNextTask();
/**
* is duty
* @param args argument
* @return if it is then true
*/
public boolean isDuty(String[] args);
/**
* process task
* @param args argument
*/
public void process(String[] args);
/**
* run task
* @param args argument
*/
public default void run(String[] args) {
if (this.isDuty(args)) this.process(args);
else this.getNextTask().run(args);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy