Klasse ArbitraryDecorator<T>

java.lang.Object
net.jqwik.api.arbitraries.ArbitraryDecorator<T>
Typparameter:
T - The type of object to be generated by this arbitrary
Alle implementierten Schnittstellen:
Cloneable, Arbitrary<T>

@API(status=MAINTAINED, since="1.4.0") public abstract class ArbitraryDecorator<T> extends Object implements Cloneable, Arbitrary<T>
Use this superclass if you want to provide a specialized type of arbitrary, e.g. with additional methods for configuration or defaults, but don't want to implement the whole Arbitrary interface yourself.
Siehe auch:
  • Konstruktordetails

    • ArbitraryDecorator

      public ArbitraryDecorator()
  • Methodendetails

    • arbitrary

      protected abstract Arbitrary<T> arbitrary()
      Implement by calling jqwik's standard DSL for building arbitraries.
      Gibt zurück:
      a new arbitrary instance
    • generator

      public RandomGenerator<T> generator(int genSize)
      Beschreibung aus Schnittstelle kopiert: Arbitrary
      Create the random generator for an arbitrary.

      Starting with version 1.4.0 the returned generator should no longer include edge cases explicitly since those will be injected in Arbitrary.generator(int, boolean)

      Angegeben von:
      generator in Schnittstelle Arbitrary<T>
      Parameter:
      genSize - a very unspecific configuration parameter that can be used to influence the configuration and behaviour of a random generator if and only if the generator wants to be influenced. Many generators are independent of genSize.

      The default value of genSize is the number of tries configured for a property. Use Arbitrary.fixGenSize(int) to fix the parameter for a given arbitrary.

      Gibt zurück:
      a new random generator instance
    • generatorWithEmbeddedEdgeCases

      public RandomGenerator<T> generatorWithEmbeddedEdgeCases(int genSize)
      Beschreibung aus Schnittstelle kopiert: Arbitrary
      Create the random generator for an arbitrary where the embedded generators, if there are any, also generate edge cases.

      Override only if there are any embedded arbitraries / generators, e.g. a container using an element generator

      Angegeben von:
      generatorWithEmbeddedEdgeCases in Schnittstelle Arbitrary<T>
      Parameter:
      genSize - See Arbitrary.generator(int) about meaning of this parameter
      Gibt zurück:
      a new random generator instance
    • exhaustive

      public Optional<ExhaustiveGenerator<T>> exhaustive(long maxNumberOfSamples)
      Beschreibung aus Schnittstelle kopiert: Arbitrary
      Create the exhaustive generator for an arbitrary. Depending on maxNumberOfSamples this can take a long time. This method must be overridden in all arbitraries that support exhaustive generation.
      Angegeben von:
      exhaustive in Schnittstelle Arbitrary<T>
      Parameter:
      maxNumberOfSamples - The maximum number of samples considered. If during generation it becomes clear that this number will be exceeded generation stops.
      Gibt zurück:
      a new exhaustive generator or Optional.empty() if it cannot be created.
    • isGeneratorMemoizable

      public boolean isGeneratorMemoizable()
      Angegeben von:
      isGeneratorMemoizable in Schnittstelle Arbitrary<T>
    • edgeCases

      public EdgeCases<T> edgeCases(int maxEdgeCases)
      Angegeben von:
      edgeCases in Schnittstelle Arbitrary<T>
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • typedClone

      protected <A extends Arbitrary<?>> A typedClone()
      Use to clone current instance with its interface type
      Typparameter:
      A - The special interface type of this arbitrary
      Gibt zurück:
      A cloned instance of this arbitrary