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

net.jqwik.api.Falsifier Maven / Gradle / Ivy

There is a newer version: 1.9.2
Show newest version
package net.jqwik.api;

import java.util.function.*;

import org.apiguardian.api.*;

import net.jqwik.api.lifecycle.*;

import static org.apiguardian.api.API.Status.*;

/**
 * This interface is no longer used anywhere in jqwik's public API
 * and could therefore be deprecated and moved to engine implementation.
 * But since it's declared to be stable it won't go away before version 2.0.
 *
 * @param  The type of
 */
@FunctionalInterface
@API(status = STABLE, since = "1.0")
public interface Falsifier {

	@API(status = INTERNAL)
	TryExecutionResult execute(T t);

	@API(status = INTERNAL)
	default Falsifier withFilter(Predicate filter) {
		return value -> {
			if (!filter.test(value)) {
				return TryExecutionResult.invalid();
			}
			return execute(value);
		};
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy