@API(status=MAINTAINED, since="1.2") public interface TypeArbitrary<T> extends Arbitrary<T>
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.
Domain
,
DomainContext
Arbitrary.ArbitraryFacade
Modifier and Type | Method and Description |
---|---|
TypeArbitrary<T> |
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.
|
TypeArbitrary<T> |
useAllConstructors()
Add all constructors (public, private or package scope) of class
T to be used
for generating values of type T |
TypeArbitrary<T> |
useAllFactoryMethods()
Add all factory methods (static methods with return type
T )
of class T to be used for generating values of type T |
TypeArbitrary<T> |
useConstructors(java.util.function.Predicate<? super java.lang.reflect.Constructor<?>> filter)
Add all constructors (public, private or package scope) of class
T to be used
for generating values of type T |
TypeArbitrary<T> |
useFactoryMethods(java.util.function.Predicate<java.lang.reflect.Method> filter)
Add all factory methods (static methods with return type
T )
of class T to be used for generating values of type T |
TypeArbitrary<T> |
usePublicConstructors()
Add public constructors of class
T to be used
for generating values of type T |
TypeArbitrary<T> |
usePublicFactoryMethods()
Add public factory methods (static methods with return type
T )
of class T to be used for generating values of type T |
allValues, array, asGeneric, collect, dontShrink, edgeCases, edgeCases, edgeCases, exhaustive, exhaustive, filter, filter, fixGenSize, flatMap, forEachValue, generator, generator, generatorWithEmbeddedEdgeCases, ignoreException, ignoreException, ignoreExceptions, ignoreExceptions, injectDuplicates, injectNull, isGeneratorMemoizable, iterator, list, map, optional, optional, sample, sampleStream, set, stream, tuple1, tuple2, tuple3, tuple4, tuple5, withoutEdgeCases
TypeArbitrary<T> usePublicConstructors()
T
to be used
for generating values of type T
TypeArbitrary<T> useAllConstructors()
T
to be used
for generating values of type T
TypeArbitrary<T> useConstructors(java.util.function.Predicate<? super java.lang.reflect.Constructor<?>> filter)
T
to be used
for generating values of type T
filter
- Predicate to add only those constructors for which the predicate returns trueTypeArbitrary<T> usePublicFactoryMethods()
T
)
of class T
to be used for generating values of type T
TypeArbitrary<T> useAllFactoryMethods()
T
)
of class T
to be used for generating values of type T
TypeArbitrary<T> useFactoryMethods(java.util.function.Predicate<java.lang.reflect.Method> filter)
T
)
of class T
to be used for generating values of type T
filter
- Predicate to add only those factory methods for which the predicate returns true@API(status=MAINTAINED, since="1.8.0") TypeArbitrary<T> enableRecursion()