net.jqwik.engine.facades.FunctionsFacadeImpl Maven / Gradle / Ivy
The newest version!
package net.jqwik.engine.facades;
import net.jqwik.api.*;
import net.jqwik.api.arbitraries.*;
import net.jqwik.engine.properties.arbitraries.*;
import org.jspecify.annotations.*;
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);
}
}