Package net.jqwik.api.arbitraries
Schnittstelle TraverseArbitrary.Traverser
- Umschließende Schnittstelle:
TraverseArbitrary<T extends @Nullable Object>
public static interface TraverseArbitrary.Traverser
A traverser describes how to travers a given type by providing a hook to
resolve a parameter into an arbitrary and a means to find all relevant
creators (constructors or factory methods) for a type that does not have a suitable default arbitrary.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfindCreators
(TypeUsage targetType) Return all creators (constructors or static factory methods) for a type to traverse.resolveParameter
(TypeUsage parameterType) Create an arbitrary for a creator parameter.
-
Methodendetails
-
resolveParameter
Create an arbitrary for a creator parameter. Only implement if you do not want to resolve the parameter through its default arbitrary (if there is one)- Parameter:
parameterType
- The typeUsage of the parameter, including annotations- Gibt zurück:
- New Arbitrary or
Optional.empty()
-
findCreators
Return all creators (constructors or static factory methods) for a type to traverse.If you return an empty set, the attempt to generate a type will be stopped by throwing an exception.
- Parameter:
targetType
- The target type for which to find creators (factory methods or constructors)- Gibt zurück:
- A set of at least one creator.
-