T - type of property parameter to apply this generator's values topublic abstract class ComponentizedGenerator<T> extends Generator<T>
| Modifier | Constructor and Description |
|---|---|
protected |
ComponentizedGenerator(Class<T> type) |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponentGenerators(List<Generator<?>> newComponents)
Adds component generators to this generator.
|
boolean |
canGenerateForParametersOfTypes(List<org.javaruntype.type.TypeParameter<?>> typeParameters) |
boolean |
canRegisterAsType(Class<?> type)
Tells whether this generator is allowed to be used for property
parameters of the given type.
|
protected List<Generator<?>> |
componentGenerators() |
void |
configure(AnnotatedType annotatedType)
Configures this generator using annotations from a given annotated
type.
|
boolean |
hasComponents()
This is intended for use only by junit-quickcheck itself, and not by
creators of custom generators.
|
void |
provide(Generators provided)
Supplies the available generators to this one.
|
canShrink, compatibleWithTypeParameter, configurationAnnotationsOn, configure, copy, doShrink, gen, gen, magnitude, narrow, numberOfNeededComponents, shrink, typespublic boolean canRegisterAsType(Class<?> type)
Generators of this type do not get called upon to generate values
for parameters of type Object.
canRegisterAsType in class Generator<T>type - type against which to test this generatortrue if the generator is allowed to participate in
generating values for property parameters of typepublic final boolean hasComponents()
GeneratorThis is intended for use only by junit-quickcheck itself, and not by creators of custom generators.
hasComponents in class Generator<T>Generator.addComponentGenerators(java.util.List)public void addComponentGenerators(List<Generator<?>> newComponents)
GeneratorAdds component generators to this generator.
Some generators need component generators to create proper values. For example, list generators require a single component generator in order to generate elements that have the type of the list parameter's type argument.
This is intended for use only by junit-quickcheck itself, and not by creators of custom generators.
addComponentGenerators in class Generator<T>newComponents - component generators to addpublic boolean canGenerateForParametersOfTypes(List<org.javaruntype.type.TypeParameter<?>> typeParameters)
canGenerateForParametersOfTypes in class Generator<T>typeParameters - a list of generic type parameterspublic void provide(Generators provided)
GeneratorSupplies the available generators to this one.
This is intended for use only by junit-quickcheck itself, and not by creators of custom generators.
public void configure(AnnotatedType annotatedType)
GeneratorConfigures this generator using annotations from a given annotated type.
This method considers only annotations that are themselves marked
with GeneratorConfiguration.
By default, the generator will configure itself using this procedure:
public method on the generator named
configure, that accepts a single parameter of the
annotation typeconfigure method reflectively, passing the
annotation as the argumentCopyright © 2019. All rights reserved.