@API(status=STABLE, since="1.0") public interface Shrinkable<T> extends java.lang.Comparable<Shrinkable<T>>
Modifier and Type | Interface and Description |
---|---|
static class |
Shrinkable.ShrinkableFacade |
Modifier and Type | Method and Description |
---|---|
default Shrinkable<java.lang.Object> |
asGeneric()
Sometimes simplifies test writing
|
default int |
compareTo(Shrinkable<T> other) |
ShrinkingDistance |
distance() |
default Shrinkable<T> |
filter(java.util.function.Predicate<T> filter) |
default <U> Shrinkable<U> |
flatMap(java.util.function.Function<T,Arbitrary<U>> flatMapper,
int tries,
long randomSeed) |
default boolean |
isSmallerThan(Shrinkable<T> other) |
default <U> Shrinkable<U> |
map(java.util.function.Function<T,U> mapper) |
ShrinkingSequence<T> |
shrink(Falsifier<T> falsifier) |
default java.util.List<Shrinkable<T>> |
shrinkingSuggestions()
Used only when several shrinkables must be shrunk in synchronicity e.g. duplicate values.
|
static <T> Shrinkable<T> |
unshrinkable(T value) |
static <T> Shrinkable<T> |
unshrinkable(T value,
ShrinkingDistance distance) |
T |
value() |
static <T> Shrinkable<T> unshrinkable(T value)
static <T> Shrinkable<T> unshrinkable(T value, ShrinkingDistance distance)
T value()
ShrinkingSequence<T> shrink(Falsifier<T> falsifier)
ShrinkingDistance distance()
@API(status=INTERNAL, since="1.2.4") default Shrinkable<java.lang.Object> asGeneric()
default <U> Shrinkable<U> map(java.util.function.Function<T,U> mapper)
default Shrinkable<T> filter(java.util.function.Predicate<T> filter)
default <U> Shrinkable<U> flatMap(java.util.function.Function<T,Arbitrary<U>> flatMapper, int tries, long randomSeed)
@API(status=INTERNAL) default int compareTo(Shrinkable<T> other)
compareTo
in interface java.lang.Comparable<Shrinkable<T>>
@API(status=INTERNAL) default boolean isSmallerThan(Shrinkable<T> other)
@API(status=INTERNAL) default java.util.List<Shrinkable<T>> shrinkingSuggestions()