Class AbstractGenerationStatus
java.lang.Object
com.pholser.junit.quickcheck.internal.generator.AbstractGenerationStatus
- All Implemented Interfaces:
GenerationStatus
- Direct Known Subclasses:
PropertyParameterGenerationContext,SimpleGenerationStatus
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.pholser.junit.quickcheck.generator.GenerationStatus
GenerationStatus.Key<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<GenerationStatus.Key<?>,Object> private final GeometricDistributionprivate final SourceOfRandomness -
Constructor Summary
ConstructorsConstructorDescriptionAbstractGenerationStatus(GeometricDistribution distro, SourceOfRandomness random) -
Method Summary
Modifier and TypeMethodDescriptionprotected final SourceOfRandomnessrandom()<T> GenerationStatussetValue(GenerationStatus.Key<T> key, T value) Associates the given value with the given key for the duration of the generation of a value for a property parameter, or until overwritten.intsize()<T> Optional<T>valueOf(GenerationStatus.Key<T> key) Retrieves the value associated with the given key.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pholser.junit.quickcheck.generator.GenerationStatus
attempts, semiAttempt
-
Field Details
-
distro
-
random
-
contextValues
-
-
Constructor Details
-
AbstractGenerationStatus
AbstractGenerationStatus(GeometricDistribution distro, SourceOfRandomness random)
-
-
Method Details
-
setValue
Description copied from interface:GenerationStatusAssociates the given value with the given key for the duration of the generation of a value for a property parameter, or until overwritten.- Specified by:
setValuein interfaceGenerationStatus- Type Parameters:
T- type of the value- Parameters:
key- a key to associate with a valuevalue- the associated value- Returns:
- self, so that calls to this method can be chained
-
valueOf
Description copied from interface:GenerationStatusRetrieves the value associated with the given key.- Specified by:
valueOfin interfaceGenerationStatus- Type Parameters:
T- type of the value associated with the key- Parameters:
key- key to look up- Returns:
- the (optional) associated value
-
size
public int size()- Specified by:
sizein interfaceGenerationStatus- Returns:
- an arbitrary "size" parameter; this value (probabilistically) increases for every successful generation
-
random
-