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

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

The newest version!
package net.jqwik.engine.facades;

import java.util.function.*;

import net.jqwik.api.*;
import net.jqwik.engine.properties.shrinking.*;

import org.jspecify.annotations.*;

/**
 * Is loaded through reflection in api module
 */
public class ShrinkableFacadeImpl extends Shrinkable.ShrinkableFacade {
	@Override
	public  Shrinkable unshrinkable(Supplier valueSupplier, ShrinkingDistance distance) {
		return new Unshrinkable<>(valueSupplier, distance);
	}

	@Override
	public  Shrinkable map(Shrinkable self, Function mapper) {
		return new MappedShrinkable<>(self, mapper);
	}

	@Override
	public  Shrinkable filter(Shrinkable self, Predicate filter) {
		return new FilteredShrinkable<>(self, filter);
	}

	@Override
	public  Shrinkable flatMap(Shrinkable self, Function> flatMapper, int tries, long randomSeed) {
		return new FlatMappedShrinkable<>(self, flatMapper, tries, randomSeed, false);
	}
}