Package net.jqwik.api
Schnittstelle Shrinkable<T extends @Nullable Object>
- Alle Superschnittstellen:
Comparable<Shrinkable<T>>
@API(status=STABLE,
since="1.0")
public interface Shrinkable<T extends @Nullable Object>
extends Comparable<Shrinkable<T>>
-
Verschachtelte Klassen - Übersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdefault Shrinkable
<Object> Sometimes simplifies test writingdefault int
compareTo
(Shrinkable<T> other) distance()
default Shrinkable
<T> default <U extends @Nullable Object>
Shrinkable<U> default Stream
<Shrinkable<T>> grow()
Grow a shrinkable to allow broader searching in flat mapped shrinkablesdefault Optional
<Shrinkable<T>> grow
(Shrinkable<?> before, Shrinkable<?> after) To be able to "move" values towards the end of collections while keeping some constraint constant it's necessary to grow a shrinkable by what another has been shrunk.default Shrinkable
<T> default <U extends @Nullable Object>
Shrinkable<U> shrink()
Create a new and finite stream of smaller or same size shrinkables; size is measured by distance().static <T extends @Nullable Object>
Shrinkable<T> supplyUnshrinkable
(Supplier<? extends T> supplier) static <T extends @Nullable Object>
Shrinkable<T> unshrinkable
(T value) static <T extends @Nullable Object>
Shrinkable<T> unshrinkable
(T value, ShrinkingDistance distance) value()
Create value freshly, so that in case of mutable objects shrinking (and reporting) can rely on untouched values.
-
Methodendetails
-
unshrinkable
-
unshrinkable
-
supplyUnshrinkable
@API(status=INTERNAL) static <T extends @Nullable Object> Shrinkable<T> supplyUnshrinkable(Supplier<? extends T> supplier) -
value
T value()Create value freshly, so that in case of mutable objects shrinking (and reporting) can rely on untouched values.- Gibt zurück:
- An un-changed instance of the value represented by this shrinkable
-
shrink
Create a new and finite stream of smaller or same size shrinkables; size is measured by distance().Same size shrinkables are allowed but they have to iterate towards a single value to prevent endless shrinking. This also means that a shrinkable must never be in its own shrink stream!
- Gibt zurück:
- a finite stream of shrinking options
-
grow
@API(status=INTERNAL, since="1.3.3") default Optional<Shrinkable<T>> grow(Shrinkable<?> before, Shrinkable<?> after) To be able to "move" values towards the end of collections while keeping some constraint constant it's necessary to grow a shrinkable by what another has been shrunk. One example is keeping a sum of values and still shrinking to the same resulting list.- Parameter:
before
- The other shrinkable before shrinkingafter
- The other shrinkable after shrinking- Gibt zurück:
- this shrinkable grown by the difference of before and after
-
grow
Grow a shrinkable to allow broader searching in flat mapped shrinkables- Gibt zurück:
- a finite stream of grown values
-
distance
ShrinkingDistance distance() -
asGeneric
Sometimes simplifies test writing- Gibt zurück:
- generic version of a shrinkable
-
map
-
filter
-
flatMap
default <U extends @Nullable Object> Shrinkable<U> flatMap(Function<? super T, ? extends Arbitrary<U>> flatMapper, int tries, long randomSeed) -
compareTo
- Angegeben von:
compareTo
in SchnittstelleComparable<T extends @Nullable Object>
-
makeUnshrinkable
-