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

org.jnario.report.ExecutableStateSwitch Maven / Gradle / Ivy

The newest version!
package org.jnario.report;

public abstract class ExecutableStateSwitch {
	
	public T doSwitch(SpecExecution execution){
		T result = null;
		if (execution instanceof Failed) {
			result = handleFailed((Failed) execution);
		}else if (execution instanceof NotRun) {
			result = handleNotRun((NotRun) execution);
		}else if (execution instanceof Passed) {
			result = handlePassed((Passed) execution);
		}else if (execution instanceof Pending) {
			result = handlePending((Pending) execution);
		}
		return result;
	}

	protected abstract T handlePassed(Passed execution);
	protected abstract T handlePending(Pending execution);
	protected abstract T handleNotRun(NotRun execution);
	protected abstract T handleFailed(Failed execution);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy