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

net.jqwik.engine.facades.FunctionsFacadeImpl Maven / Gradle / Ivy

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

import net.jqwik.api.*;
import net.jqwik.api.arbitraries.*;
import net.jqwik.engine.properties.arbitraries.*;

import static net.jqwik.engine.support.JqwikReflectionSupport.*;

/**
 * Is loaded through reflection in api module
 */
public class FunctionsFacadeImpl extends Functions.FunctionsFacade {

	@Override
	public void ensureFunctionalType(Class functionalType) {
		if (!isFunctionalType(functionalType)) {
			throw new NotAFunctionalTypeException(functionalType);
		}
	}

	@SuppressWarnings("unchecked")
	@Override
	public  FunctionArbitrary function(Class functionalType, Arbitrary resultArbitrary) {
		return (FunctionArbitrary) new DefaultFunctionArbitrary<>(functionalType, resultArbitrary);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy