Package net.jqwik.api
Class Builders.CombinableBuilder<B,T>
- java.lang.Object
-
- net.jqwik.api.Builders.CombinableBuilder<B,T>
-
- Type Parameters:
B
- The builder's type
- Enclosing class:
- Builders
public static class Builders.CombinableBuilder<B,T> extends java.lang.Object
Functionality to manipulate a builder. Instances are created throughBuilders.BuilderCombinator.use(Arbitrary)
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Builders.BuilderCombinator<B>
in(java.util.function.BiFunction<B,T,B> toFunction)
Use the last provided arbitrary to change the builder object.Builders.BuilderCombinator<B>
inSetter(java.util.function.BiConsumer<B,T> setter)
Use the last provided arbitrary to change the builder object and proceed with the same builder.Builders.CombinableBuilder<B,T>
withProbability(double probabilityOfUse)
Set probability for using this arbitrary
-
-
-
Method Detail
-
withProbability
public Builders.CombinableBuilder<B,T> withProbability(double probabilityOfUse)
Set probability for using this arbitrary- Parameters:
probabilityOfUse
- Must be between 0.0 and 1.0- Returns:
- Builders.BuilderCombinator instance
-
in
public Builders.BuilderCombinator<B> in(java.util.function.BiFunction<B,T,B> toFunction)
Use the last provided arbitrary to change the builder object. Potentially create a different kind of builder.- Parameters:
toFunction
- Use value provided by arbitrary to set current builder and return builder of same type.- Returns:
- new Builders.BuilderCombinator instance
-
inSetter
public Builders.BuilderCombinator<B> inSetter(java.util.function.BiConsumer<B,T> setter)
Use the last provided arbitrary to change the builder object and proceed with the same builder. The most common scenario is a builder the methods of which do not return a new builder.- Parameters:
setter
- Use value provided by arbitrary to change a builder's property.- Returns:
- new Builders.BuilderCombinator instance with same embedded builder
-
-