Class FunctionGenerator<F,T>

java.lang.Object
com.pholser.junit.quickcheck.generator.Generator<T>
com.pholser.junit.quickcheck.generator.ComponentizedGenerator<com.google.common.base.Function>
com.pholser.junit.quickcheck.guava.generator.FunctionGenerator<F,T>
Type Parameters:
F - parameter type of the generated functions
T - return type of the generated functions
All Implemented Interfaces:
Gen<com.google.common.base.Function>, Shrink<com.google.common.base.Function>

public class FunctionGenerator<F,T> extends ComponentizedGenerator<com.google.common.base.Function>
Produces values of type Function.
  • Constructor Details

    • FunctionGenerator

      public FunctionGenerator()
  • Method Details

    • generate

      public com.google.common.base.Function<F,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
    • numberOfNeededComponents

      public int numberOfNeededComponents()
      Description copied from class: Generator

      This is intended for use only by junit-quickcheck itself, and not by creators of custom generators.

      Overrides:
      numberOfNeededComponents in class Generator<com.google.common.base.Function>
      Returns:
      how many component generators this generator needs
      See Also: