Package at.jku.ssw.fp.sect11_3.check4j
Class Shrinkers
- java.lang.Object
-
- at.jku.ssw.fp.sect11_3.check4j.Shrinkers
-
public class Shrinkers extends Object
Class providing shrinkers for various value types.- Author:
- Herbert Praehofer
-
-
Field Summary
Fields Modifier and Type Field Description static Shrinker<Character>
charShrinker
A shrinker for char values.static Shrinker<Double>
doubleShrinker
A shrinker for double values.static Shrinker<Integer>
integerShrinkerRec
A shrinker forInteger
values.static Shrinker<FList<Integer>>
intListShrinker
A shrinker for lists of integersstatic Shrinker<Integer>
intShrinker
A shrinker for arbitrary int values.static Shrinker<Integer>
posIntShrinker
A shrinker for positive int values.
-
Constructor Summary
Constructors Constructor Description Shrinkers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static <A> Stream<A>
concat(Stream<A>... streams)
Concatenates multiple streams to a single stream.static <E> Shrinker<E>
empty()
An shrinker which does not provide values.static <E> Shrinker<FList<E>>
fListShrinker()
A shrinker forFList
lists.static <E> Shrinker<FList<E>>
fListShrinker(Shrinker<E> eShrinker)
A shrinker forFList
lists where a given shrinker is used for shrinking the elements.
-
-
-
Method Detail
-
empty
public static <E> Shrinker<E> empty()
An shrinker which does not provide values.- Type Parameters:
E
- the type of values (for type checking)- Returns:
- the shrinker not providing a simple shrunk value
-
fListShrinker
public static <E> Shrinker<FList<E>> fListShrinker()
A shrinker forFList
lists. Lists are shrunk by removing elements.- Type Parameters:
E
- the type of list elements- Returns:
- a shrinker for lists
-
concat
@SafeVarargs private static <A> Stream<A> concat(Stream<A>... streams)
Concatenates multiple streams to a single stream.- Type Parameters:
A
- the type of elements of the stream- Parameters:
streams
- the streams to concatenate- Returns:
- the concatenated stream
-
fListShrinker
public static <E> Shrinker<FList<E>> fListShrinker(Shrinker<E> eShrinker)
A shrinker forFList
lists where a given shrinker is used for shrinking the elements. This shrinker shrinks list by removing elements and shrinking elements by the given shrinker.- Type Parameters:
E
- the type of list elements- Parameters:
eShrinker
- the shrinker for element values- Returns:
- the shrinker for lists
-
-