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

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> mapper, long nextLong) {
		return new FlatMappedShrinkable<>(self, mapper, nextLong);
	}

	@Override
	public  Shrinkable flatMap(
		Shrinkable self,
		Function> mapper,
		int genSize,
		long nextLong,
		boolean withEmbeddedEdgeCases
	) {
		return new FlatMappedShrinkable<>(self, mapper, genSize, nextLong, withEmbeddedEdgeCases);
	}

	@Override
	public  RandomGenerator filter(RandomGenerator self, Predicate 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> 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[] exceptionTypes, int maxThrows) {
		return new IgnoreExceptionGenerator<>(self, exceptionTypes, maxThrows);
	}
}