Package net.jqwik.api.arbitraries
Interface StreamableArbitrary<T,U>
- All Superinterfaces:
Arbitrary<U>
,SizableArbitrary<U>
- All Known Subinterfaces:
ArrayArbitrary<T,
,A> IteratorArbitrary<T>
,ListArbitrary<T>
,SetArbitrary<T>
,StreamArbitrary<T>
@API(status=MAINTAINED,
since="1.2.1")
public interface StreamableArbitrary<T,U>
extends SizableArbitrary<U>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.jqwik.api.Arbitrary
Arbitrary.ArbitraryFacade
-
Method Summary
Modifier and TypeMethodDescriptionofMaxSize
(int maxSize) Set upper size boundarymaxSize
(included).ofMinSize
(int minSize) Set lower size boundaryminSize
(included).default StreamableArbitrary<T,
U> ofSize
(int size) Fix the size tosize
.<R> Arbitrary<R>
reduce
(R initial, BiFunction<R, T, R> accumulator) Given aninitial
argument useaccumulator
to produce the final result.Add the constraint that elements of the generated streamable must be unique, i.e. no two elements must return true when being compared using Object.equals(Object).StreamableArbitrary<@Nullable T,
U> uniqueElements
(Function<@Nullable T, Object> by) Add the constraint that elements of the generated streamable must be unique relating to an element's "feature" being extracted using theby
function.withSizeDistribution
(RandomDistribution distribution) Set distributiondistribution
of size of generated arbitraryMethods 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, ignoreException, ignoreExceptions, ignoreExceptions, injectDuplicates, injectNull, isGeneratorMemoizable, iterator, list, map, optional, optional, sample, sampleStream, set, stream, tuple1, tuple2, tuple3, tuple4, tuple5, withoutEdgeCases
-
Method Details
-
reduce
Given aninitial
argument useaccumulator
to produce the final result.- Type Parameters:
R
- The result type- Parameters:
initial
- The initial argument. Also the result if streamable is emptyaccumulator
- The function used to reduce a streamable into a result one by one- Returns:
- The result of accumulating all elements in streamable
-
ofSize
Fix the size tosize
.- Specified by:
ofSize
in interfaceSizableArbitrary<T>
-
ofMinSize
Set lower size boundaryminSize
(included).- Specified by:
ofMinSize
in interfaceSizableArbitrary<T>
-
ofMaxSize
Set upper size boundarymaxSize
(included).- Specified by:
ofMaxSize
in interfaceSizableArbitrary<T>
-
withSizeDistribution
@API(status=EXPERIMENTAL, since="1.5.3") StreamableArbitrary<T,U> withSizeDistribution(RandomDistribution distribution) Set distributiondistribution
of size of generated arbitrary- Specified by:
withSizeDistribution
in interfaceSizableArbitrary<T>
-
uniqueElements
Add the constraint that elements of the generated streamable must be unique, i.e. no two elements must return true when being compared using Object.equals(Object).The constraint can be combined with other uniqueElements(Function) constraints.
- Returns:
- new arbitrary instance
-
uniqueElements
@API(status=MAINTAINED, since="1.7.3") StreamableArbitrary<@Nullable T,U> uniqueElements(Function<@Nullable T, Object> by) Add the constraint that elements of the generated streamable must be unique relating to an element's "feature" being extracted using theby
function. The extracted features are being compared using Object.equals(Object).The constraint can be combined with other uniqueElements(Function) constraints.
- Returns:
- new arbitrary instance
-