Package net.jqwik.api

Interface RandomGenerator<T>


  • @API(status=STABLE,
         since="1.0")
    public interface RandomGenerator<T>
    • 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)
      • 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)
      • 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)
      • ignoreException

        @API(status=INTERNAL)
        default RandomGenerator<T> ignoreException​(java.lang.Class<? extends java.lang.Throwable> exceptionType)