Class LambdaGenerator<T,U>

java.lang.Object
com.pholser.junit.quickcheck.generator.Generator<T>
com.pholser.junit.quickcheck.internal.generator.LambdaGenerator<T,U>
All Implemented Interfaces:
Gen<T>, Shrink<T>

public class LambdaGenerator<T,U> extends Generator<T>
  • Field Details

    • lambdaType

      private final Class<T> lambdaType
    • returnValueGenerator

      private final Generator<U> returnValueGenerator
  • Constructor Details

    • LambdaGenerator

      LambdaGenerator(Class<T> lambdaType, Generator<U> returnValueGenerator)
  • Method Details

    • generate

      public T generate(SourceOfRandomness random, GenerationStatus status)
      Description copied from interface: Gen
      Generates a value, possibly influenced by a source of randomness and metadata about the generation.
      Parameters:
      random - source of randomness to be used when generating the value
      status - an object that can be used to influence the generated value. For example, generating lists can use the size method to generate lists with a given number of elements.
      Returns:
      the generated value