net.jqwik.engine.facades.RandomGeneratorFacadeImpl Maven / Gradle / Ivy
The newest version!
package net.jqwik.engine.facades;
import java.util.*;
import java.util.function.*;
import net.jqwik.api.*;
import net.jqwik.engine.properties.arbitraries.randomized.*;
import net.jqwik.engine.properties.shrinking.*;
import org.jspecify.annotations.*;
/**
* Is loaded through reflection in api module
*/
public class RandomGeneratorFacadeImpl extends RandomGenerator.RandomGeneratorFacade {
@Override
public Shrinkable flatMap(Shrinkable self, Function super T, ? extends RandomGenerator> mapper, long nextLong) {
return new FlatMappedShrinkable<>(self, mapper, nextLong);
}
@Override
public Shrinkable flatMap(
Shrinkable self,
Function super T, ? extends Arbitrary> mapper,
int genSize,
long nextLong,
boolean withEmbeddedEdgeCases
) {
return new FlatMappedShrinkable<>(self, mapper, genSize, nextLong, withEmbeddedEdgeCases);
}
@Override
public RandomGenerator filter(RandomGenerator self, Predicate super T> filterPredicate, int maxMisses) {
return new FilteredGenerator<>(self, filterPredicate, maxMisses);
}
@Override
public RandomGenerator withEdgeCases(RandomGenerator self, int genSize, EdgeCases edgeCases) {
return RandomGenerators.withEdgeCases(self, genSize, edgeCases);
}
@Override
public RandomGenerator> collect(RandomGenerator self, Predicate super List extends T>> until) {
return new CollectGenerator<>(self, until);
}
@Override
public RandomGenerator injectDuplicates(RandomGenerator self, double duplicateProbability) {
return new InjectDuplicatesGenerator<>(self, duplicateProbability);
}
@Override
public RandomGenerator ignoreExceptions(RandomGenerator self, Class extends Throwable>[] exceptionTypes, int maxThrows) {
return new IgnoreExceptionGenerator<>(self, exceptionTypes, maxThrows);
}
}