Class PropertyParameterGenerationContext

java.lang.Object
com.pholser.junit.quickcheck.internal.generator.AbstractGenerationStatus
com.pholser.junit.quickcheck.internal.generator.PropertyParameterGenerationContext
All Implemented Interfaces:
GenerationStatus

public class PropertyParameterGenerationContext extends AbstractGenerationStatus
  • Field Details

    • parameter

      private final PropertyParameterContext parameter
    • evaluator

      private final ConstraintEvaluator evaluator
    • generator

      private final Generator<?> generator
    • sampleSize

      private final int sampleSize
    • successfulEvaluations

      private int successfulEvaluations
    • discards

      private int discards
    • semiAttempts

      private int semiAttempts
  • Constructor Details

  • Method Details

    • initializeRandomness

      private static SourceOfRandomness initializeRandomness(PropertyParameterContext p, SourceOfRandomness r)
    • generate

      public Object generate()
    • shrink

      public List<Object> shrink(Object larger)
    • evaluate

      private boolean evaluate(Object value)
    • tooManyDiscards

      private boolean tooManyDiscards()
    • size

      public int size()
      Specified by:
      size in interface GenerationStatus
      Overrides:
      size in class AbstractGenerationStatus
      Returns:
      an arbitrary "size" parameter; this value (probabilistically) increases for every successful generation
    • attempts

      public int attempts()
      Returns:
      how many attempts have been made to generate a value for a property parameter
    • semiAttempt

      public void semiAttempt()
      Description copied from interface: GenerationStatus

      Signals part of an attempt to generate a value.

      Mostly for use by junit-quickcheck itself; generators can call this to convince the framework that it's doing work to generate a complex value, but doing so is not strictly necessary.

    • effectiveSeed

      public long effectiveSeed()
    • sampleSize

      public int sampleSize()
    • name

      public String name()
    • magnitude

      public BigDecimal magnitude(Object value)