Class ArbitraryConfiguratorBase

java.lang.Object
net.jqwik.api.configurators.ArbitraryConfiguratorBase
All Implemented Interfaces:
Comparable<ArbitraryConfigurator>, ArbitraryConfigurator

@API(status=MAINTAINED, since="1.0") public abstract class ArbitraryConfiguratorBase extends Object implements ArbitraryConfigurator
Using this base class is the easiest way to make use of the configuration mechanism described in ArbitraryConfigurator

Implementations must be registered in /META-INF/services/net.jqwik.api.configurators.ArbitraryConfigurator so that they will be automatically considered for arbitrary configuration.

Some examples that come with jqwik:

  • Constructor Details

    • ArbitraryConfiguratorBase

      public ArbitraryConfiguratorBase()
  • Method Details

    • configure

      public <T> Arbitrary<T> configure(Arbitrary<T> arbitrary, TypeUsage targetType)
      Description copied from interface: ArbitraryConfigurator
      Configure a given arbitrary and return the configured instance.
      Specified by:
      configure in interface ArbitraryConfigurator
      Parameters:
      arbitrary - The arbitrary instance to be configured
      targetType - The type of the object to be generated by the arbitrary
      Returns:
      the newly configured arbitrary instance
    • acceptTargetType

      protected boolean acceptTargetType(TypeUsage targetType)
      Override if configurator only works for certain types of domain objects
      Parameters:
      targetType - The concrete domain type to be generated