Class EnumGenerator
java.lang.Object
com.pholser.junit.quickcheck.generator.Generator<Enum>
com.pholser.junit.quickcheck.internal.generator.EnumGenerator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTells whether this generator is allowed to participate in theShrinkprocess for the given "larger" value.Enum<?>generate(SourceOfRandomness random, GenerationStatus status) Generates a value, possibly influenced by a source of randomness and metadata about the generation.Methods inherited from class com.pholser.junit.quickcheck.generator.Generator
addComponentGenerators, canGenerateForParametersOfTypes, canRegisterAsType, compatibleWithTypeParameter, configurationAnnotationsOn, configure, configure, copy, doShrink, gen, gen, hasComponents, magnitude, narrow, numberOfNeededComponents, provide, shrink, types
-
Field Details
-
enumType
-
-
Constructor Details
-
EnumGenerator
EnumGenerator(Class<?> enumType)
-
-
Method Details
-
generate
Description copied from interface:GenGenerates 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 valuestatus- an object that can be used to influence the generated value. For example, generating lists can use thesizemethod to generate lists with a given number of elements.- Returns:
- the generated value
-
canShrink
Description copied from class:GeneratorTells whether this generator is allowed to participate in the
Shrinkprocess 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.
-