Package net.jqwik.api.arbitraries
Interface StreamableArbitrary<T,U>
-
- All Superinterfaces:
Arbitrary<U>
,SizableArbitrary<U>
- All Known Subinterfaces:
IteratorArbitrary<T>
,ListArbitrary<T>
,SetArbitrary<T>
,StreamArbitrary<T>
@API(status=MAINTAINED, since="1.2.1") public interface StreamableArbitrary<T,U> extends SizableArbitrary<U>
Fluent interface to add functionality to arbitraries whose generation artefacts can be streamed, e.g.List
,Set
,Stream
and Arrays
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.jqwik.api.Arbitrary
Arbitrary.ArbitraryFacade
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StreamableArbitrary<T,U>
ofMaxSize(int maxSize)
Set upper size boundarymaxSize
(included).StreamableArbitrary<T,U>
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, java.util.function.BiFunction<R,T,R> accumulator)
Given aninitial
argument useaccumulator
to produce the final result.-
Methods inherited from interface net.jqwik.api.Arbitrary
allValues, array, asGeneric, collect, dontShrink, edgeCases, exhaustive, exhaustive, filter, fixGenSize, flatMap, forEachValue, generator, ignoreException, injectDuplicates, injectNull, isUnique, iterator, list, map, optional, sample, sampleStream, set, stream, tuple1, tuple2, tuple3, tuple4, tuple5, unique
-
-
-
-
Method Detail
-
reduce
<R> Arbitrary<R> reduce(R initial, java.util.function.BiFunction<R,T,R> accumulator)
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
default StreamableArbitrary<T,U> ofSize(int size)
Fix the size tosize
.- Specified by:
ofSize
in interfaceSizableArbitrary<T>
-
ofMinSize
StreamableArbitrary<T,U> ofMinSize(int minSize)
Set lower size boundaryminSize
(included).- Specified by:
ofMinSize
in interfaceSizableArbitrary<T>
-
ofMaxSize
StreamableArbitrary<T,U> ofMaxSize(int maxSize)
Set upper size boundarymaxSize
(included).- Specified by:
ofMaxSize
in interfaceSizableArbitrary<T>
-
-