Interface ChainArbitrary<T>

All Superinterfaces:
Arbitrary<Chain<T>>

@API(status=EXPERIMENTAL, since="1.7.0") public interface ChainArbitrary<T> extends Arbitrary<Chain<T>>
  • Method Details

    • addTransformation

      ChainArbitrary<T> addTransformation(int weight, Transformation<T> provider)
      Add an additional Transformation.
      Parameters:
      weight - Determines the relative probability of a transformer to be chosen.
      provider - The provider to add.
      Returns:
      instance of arbitrary
    • addTransformation

      default ChainArbitrary<T> addTransformation(Transformation<T> provider)
      Add an additional Transformation with a default weight of 1.
      Parameters:
      provider - The provider to add.
      Returns:
      instance of arbitrary
    • withMaxTransformations

      ChainArbitrary<T> withMaxTransformations(int maxTransformations)
      Set the intended number of transformations of generated chains.

      Setting maxTransformations to -1 creates a potentially infinite chain. Such a chain will only end when a Transformer.endOfChain() is applied.

    • infinite

      default ChainArbitrary<T> infinite()
      Create a potentially infinite chain. Such a chain will only end when a Transformer.endOfChain() is applied.
    • improveShrinkingWith

      ChainArbitrary<T> improveShrinkingWith(Supplier<ChangeDetector<T>> detectorSupplier)
      Set supplier for the type specific ChangeDetector which can make shrinking of chains more effective.
      Parameters:
      detectorSupplier - A function to create a new ChangeDetector instance.