Package net.jqwik.api.arbitraries
Interface TypeArbitrary<T>
- All Superinterfaces:
Arbitrary<T>
Fluent interface to configure arbitraries that try to generate instances
of a given type
T
from the type's available constructors and factory methods.
When constructors and factory methods have parameters those parameters will be resolved by searching for matching registered arbitrary providers. The searching is performed either globally or in the property method's specified domain contexts.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.jqwik.api.Arbitrary
Arbitrary.ArbitraryFacade
-
Method Summary
Modifier and TypeMethodDescriptionEnable recursive use of type arbitrary: If any parameter of a creator function does not have an associated arbitrary (globally registered or through a domain context), jqwik will try to resolve this parameter using its type information as weill.use
(Executable creator) Deprecated.No longer supported.Add all constructors (public, private or package scope) of classT
to be used for generating values of typeT
Add all factory methods (static methods with return typeT
) of classT
to be used for generating values of typeT
useConstructors
(Predicate<? super Constructor<?>> filter) Add all constructors (public, private or package scope) of classT
to be used for generating values of typeT
useFactoryMethods
(Predicate<Method> filter) Add all factory methods (static methods with return typeT
) of classT
to be used for generating values of typeT
Add public constructors of classT
to be used for generating values of typeT
Add public factory methods (static methods with return typeT
) of classT
to be used for generating values of typeT
Methods inherited from interface net.jqwik.api.Arbitrary
allValues, array, asGeneric, collect, dontShrink, edgeCases, edgeCases, edgeCases, exhaustive, exhaustive, filter, filter, fixGenSize, flatMap, forEachValue, generator, generator, generatorWithEmbeddedEdgeCases, ignoreException, ignoreExceptions, injectDuplicates, injectNull, isGeneratorMemoizable, iterator, list, map, optional, optional, sample, sampleStream, set, stream, tuple1, tuple2, tuple3, tuple4, tuple5, withoutEdgeCases
-
Method Details
-
use
Deprecated.No longer supported. Will be removed in 1.8.0.Add another creator (function or constructor) to be used for generating values of typeT
- Parameters:
creator
- The static function or constructor- Returns:
- new arbitrary instance
-
usePublicConstructors
TypeArbitrary<T> usePublicConstructors()Add public constructors of classT
to be used for generating values of typeT
- Returns:
- new arbitrary instance
-
useAllConstructors
TypeArbitrary<T> useAllConstructors()Add all constructors (public, private or package scope) of classT
to be used for generating values of typeT
- Returns:
- new arbitrary instance
-
useConstructors
Add all constructors (public, private or package scope) of classT
to be used for generating values of typeT
- Parameters:
filter
- Predicate to add only those constructors for which the predicate returns true- Returns:
- new arbitrary instance
-
usePublicFactoryMethods
TypeArbitrary<T> usePublicFactoryMethods()Add public factory methods (static methods with return typeT
) of classT
to be used for generating values of typeT
- Returns:
- new arbitrary instance
-
useAllFactoryMethods
TypeArbitrary<T> useAllFactoryMethods()Add all factory methods (static methods with return typeT
) of classT
to be used for generating values of typeT
- Returns:
- new arbitrary instance
-
useFactoryMethods
Add all factory methods (static methods with return typeT
) of classT
to be used for generating values of typeT
- Parameters:
filter
- Predicate to add only those factory methods for which the predicate returns true- Returns:
- new arbitrary instance
-
enableRecursion
Enable recursive use of type arbitrary: If any parameter of a creator function does not have an associated arbitrary (globally registered or through a domain context), jqwik will try to resolve this parameter using its type information as weill.- Returns:
- new arbitrary instance
-