Interface ArbitraryProvider

    • Method Detail

      • canProvideFor

        boolean canProvideFor​(TypeUsage targetType)
        Return true if the provider is suitable for targetType
      • provideFor

        java.util.Set<Arbitrary<?>> provideFor​(TypeUsage targetType,
                                               ArbitraryProvider.SubtypeProvider subtypeProvider)
        This is the method you must override in your own implementations of ArbitraryProvider. It should return a set of arbitrary instances for a given targetType.

        Only targetTypes that have been allowed by canProvideFor(TypeUsage) will be given to this method.

        For each try a single, randomly chosen element of the set will be used to generate all objects represented by this arbitrary. This is necessary in order to make generation of parameterized types stable.

        subtypeProvider can be used to get the arbitraries for any type argument of targetType.
      • priority

        default int priority()
        Providers with higher priority will replace providers with lower priority. If there is more than one provider for a given type with the same priority, there results will add up in a single set of arbitraries to use.
        • Override with value > 0 to replace most of _jqwik_'s default providers.
        • Override with value > 100 to replace arbitrary provisioning for unrestricted type variables and wildcard types.
        • Override with value > 100 to replace arbitrary provisioning for plain type Object.