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

net.jqwik.engine.execution.pipeline.TaskExecutionResult Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
package net.jqwik.engine.execution.pipeline;

import java.util.*;

public interface TaskExecutionResult {

	static TaskExecutionResult success() {
		return new TaskExecutionResult() {

			@Override
			public boolean successful() {
				return true;
			}

			@Override
			public Optional throwable() {
				return Optional.empty();
			}

			@Override
			public String toString() {
				return "TaskExecutionResult(successful)";
			}
		};
	}

	static TaskExecutionResult failure(Throwable throwable) {
		return new TaskExecutionResult() {

			@Override
			public boolean successful() {
				return false;
			}

			@Override
			public Optional throwable() {
				return Optional.ofNullable(throwable);
			}

			@Override
			public String toString() {
				return String.format("TaskExecutionResult(failure): %s", throwable.getMessage());
			}
		};
	}

	boolean successful();

	Optional throwable();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy