|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pholser.junit.quickcheck.generator.Lambdas
public final class Lambdas
Helper class for creating instances of "functional interfaces".
| Method Summary | ||
|---|---|---|
static
|
makeLambda(Class<T> lambdaType,
Generator<U> returnValueGenerator,
GenerationStatus status)
Creates an instance of a given "functional interface" type, whose single abstract method returns values of the type produced by the given generator. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T,U> T makeLambda(Class<T> lambdaType,
Generator<U> returnValueGenerator,
GenerationStatus status)
Creates an instance of a given "functional interface" type, whose single abstract method returns values of the type produced by the given generator. The arguments to the lambda's single method will be used to perturb a random generator that will be used to generate the return value of that method.
junit-quickcheck uses this to create random values for theory parameters whose type is determined to be a
"functional interface" (an interface with a single abstract method that does not override a method from
Object. Custom generators for functional interface types can use this also.
T - the functional interface type tokenU - the type of the generated return value of the functional interface methodlambdaType - a functional interface type tokenreturnValueGenerator - a generator for the return type of the functional interface's single methodstatus - an object to be passed along to the generator that will produce the functional interface's
method return value
IllegalArgumentException - if lambdaType is not a functional interface type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||