| Constructor and Description |
|---|
EnumGenerator(Class<?> enumType) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canShrink(Object larger)
Tells whether this generator is allowed to participate in the
Shrink process for the given "larger" value. |
void |
configure(ValuesOf flag) |
Enum<?> |
generate(SourceOfRandomness random,
GenerationStatus status)
Produces a value for a property parameter.
|
addComponentGenerators, canGenerateForParametersOfTypes, canRegisterAsType, compatibleWithTypeParameter, configurationAnnotationsOn, configure, configure, doShrink, hasComponents, narrow, numberOfNeededComponents, provideRepository, shrink, typespublic EnumGenerator(Class<?> enumType)
public void configure(ValuesOf flag)
public Enum<?> generate(SourceOfRandomness random, GenerationStatus status)
GeneratorProduces a value for a property parameter.
A generator may raise an unchecked exception if some condition exists which would lead to a confusing generation -- for example, if a generator honored a "range" configuration, and the endpoints were transposed.
generate in class Generator<Enum>random - source of randomness to be used when generating the valuestatus - an object that the generator can use to influence the
value it produces. For example, a generator for lists can use the
size method to generate lists with a
given number of elements.public boolean canShrink(Object larger)
GeneratorTells whether this generator is allowed to participate in the
Shrink process for the given "larger" value.
Unless overridden, the only criterion for whether a generator is allowed to participate in shrinking a value is if the value can be safely cast to the type of values the generator produces.
Copyright © 2016. All rights reserved.