Package net.jqwik.api
Interface RandomGenerator<T>
-
@API(status=STABLE, since="1.0") public interface RandomGenerator<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RandomGenerator.RandomGeneratorFacade
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RandomGenerator<java.util.List<T>>
collect(java.util.function.Predicate<java.util.List<T>> until)
default RandomGenerator<T>
dontShrink()
default RandomGenerator<T>
filter(java.util.function.Predicate<T> filterPredicate, int maxMisses)
default <U> RandomGenerator<U>
flatMap(java.util.function.Function<T,Arbitrary<U>> mapper, int genSize, boolean withEmbeddedEdgeCases)
default <U> RandomGenerator<U>
flatMap(java.util.function.Function<T,RandomGenerator<U>> mapper)
default RandomGenerator<T>
ignoreExceptions(int maxThrows, java.lang.Class<? extends java.lang.Throwable>[] exceptionTypes)
default RandomGenerator<T>
injectDuplicates(double duplicateProbability)
default <U> RandomGenerator<U>
map(java.util.function.Function<T,U> mapper)
default <U> RandomGenerator<U>
mapShrinkable(java.util.function.Function<Shrinkable<T>,Shrinkable<U>> mapper)
Shrinkable<T>
next(java.util.Random random)
default java.util.stream.Stream<Shrinkable<T>>
stream(java.util.Random random)
default RandomGenerator<T>
withEdgeCases(int genSize, EdgeCases<T> edgeCases)
-
-
-
Method Detail
-
next
Shrinkable<T> next(java.util.Random random)
- Parameters:
random
- the source of randomness. Injected by jqwik itself.- Returns:
- the next generated value wrapped within the Shrinkable interface. The method must ALWAYS return a next value.
-
map
@API(status=INTERNAL) default <U> RandomGenerator<U> map(java.util.function.Function<T,U> mapper)
-
mapShrinkable
@API(status=INTERNAL) default <U> RandomGenerator<U> mapShrinkable(java.util.function.Function<Shrinkable<T>,Shrinkable<U>> mapper)
-
flatMap
@API(status=INTERNAL) default <U> RandomGenerator<U> flatMap(java.util.function.Function<T,RandomGenerator<U>> mapper)
-
flatMap
@API(status=INTERNAL) default <U> RandomGenerator<U> flatMap(java.util.function.Function<T,Arbitrary<U>> mapper, int genSize, boolean withEmbeddedEdgeCases)
-
filter
@API(status=INTERNAL) default RandomGenerator<T> filter(java.util.function.Predicate<T> filterPredicate, int maxMisses)
-
withEdgeCases
@API(status=INTERNAL) default RandomGenerator<T> withEdgeCases(int genSize, EdgeCases<T> edgeCases)
-
stream
@API(status=INTERNAL) default java.util.stream.Stream<Shrinkable<T>> stream(java.util.Random random)
-
collect
@API(status=INTERNAL) default RandomGenerator<java.util.List<T>> collect(java.util.function.Predicate<java.util.List<T>> until)
-
injectDuplicates
@API(status=INTERNAL) default RandomGenerator<T> injectDuplicates(double duplicateProbability)
-
ignoreExceptions
@API(status=INTERNAL) default RandomGenerator<T> ignoreExceptions(int maxThrows, java.lang.Class<? extends java.lang.Throwable>[] exceptionTypes)
-
dontShrink
@API(status=INTERNAL) default RandomGenerator<T> dontShrink()
-
-