net.jqwik.api.ExhaustiveGenerator Maven / Gradle / Ivy
package net.jqwik.api;
import java.util.function.*;
import org.apiguardian.api.*;
import static org.apiguardian.api.API.Status.*;
/**
* Used only internally to run and compute exhaustive generation of parameters
*/
@API(status = INTERNAL)
public interface ExhaustiveGenerator extends Iterable {
long MAXIMUM_SAMPLES_TO_GENERATE = Integer.MAX_VALUE;
@API(status = INTERNAL)
abstract class ExhaustiveGeneratorFacade {
private static final ExhaustiveGeneratorFacade implementation;
static {
implementation = FacadeLoader.load(ExhaustiveGeneratorFacade.class);
}
public abstract ExhaustiveGenerator map(ExhaustiveGenerator self, Function mapper);
public abstract ExhaustiveGenerator filter(ExhaustiveGenerator self, Predicate filterPredicate);
public abstract ExhaustiveGenerator injectNull(ExhaustiveGenerator self);
public abstract ExhaustiveGenerator ignoreException(ExhaustiveGenerator self, Class extends Throwable> exceptionType);
}
/**
* @return the maximum number of values that will be generated
*/
long maxCount();
default ExhaustiveGenerator map(Function mapper) {
return ExhaustiveGeneratorFacade.implementation.map(this, mapper);
}
default ExhaustiveGenerator filter(Predicate filterPredicate) {
return ExhaustiveGeneratorFacade.implementation.filter(this, filterPredicate);
}
default ExhaustiveGenerator injectNull() {
return ExhaustiveGeneratorFacade.implementation.injectNull(this);
}
default ExhaustiveGenerator ignoreException(Class extends Throwable> exceptionType) {
return ExhaustiveGeneratorFacade.implementation.ignoreException(this, exceptionType);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy