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 extends T> valueSupplier, ShrinkingDistance distance) {
return new Unshrinkable<>(valueSupplier, distance);
}
@Override
public Shrinkable map(Shrinkable self, Function super T, ? extends U> mapper) {
return new MappedShrinkable<>(self, mapper);
}
@Override
public Shrinkable filter(Shrinkable self, Predicate super T> filter) {
return new FilteredShrinkable<>(self, filter);
}
@Override
public Shrinkable flatMap(Shrinkable self, Function super T, ? extends Arbitrary> flatMapper, int tries, long randomSeed) {
return new FlatMappedShrinkable<>(self, flatMapper, tries, randomSeed, false);
}
}