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

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

There is a newer version: 1.9.1
Show 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.*;

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

	@Override
	public  RandomGenerator filter(RandomGenerator self, Predicate filterPredicate) {
		return new FilteredGenerator<>(self, filterPredicate);
	}

	@Override
	public  RandomGenerator withEdgeCases(RandomGenerator self, int genSize, List> edgeCases) {
		return RandomGenerators.withEdgeCases(self, genSize, edgeCases);
	}

	@Override
	public  RandomGenerator withSamples(RandomGenerator self, T[] samples) {
		return new WithSamplesGenerator<>(self, samples);
	}

	@Override
	public  RandomGenerator unique(RandomGenerator self) {
		return new UniqueGenerator<>(self);
	}

	@Override
	public  RandomGenerator> collect(RandomGenerator self, Predicate> until) {
		return new CollectGenerator<>(self, until);
	}
}